X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=daemon%2Fzerofree.c;h=05a547bd59e91bda4ab44c8a1e720b8766abeccf;hb=2d9953097b6d3b71122d444a4550047e97aee009;hp=ed7a3fc453823f50f19964f56fdc54adfec76f9e;hpb=56bef498f46ac3dd580f4bde3c8f3ed2fe688826;p=libguestfs.git diff --git a/daemon/zerofree.c b/daemon/zerofree.c index ed7a3fc..05a547b 100644 --- a/daemon/zerofree.c +++ b/daemon/zerofree.c @@ -1,5 +1,5 @@ /* libguestfs - the guestfsd daemon - * Copyright (C) 2009 Red Hat Inc. + * Copyright (C) 2009 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,15 +26,21 @@ #include "daemon.h" #include "actions.h" +#include "optgroups.h" int -do_zerofree (char *device) +optgroup_zerofree_available (void) +{ + int r = access ("/usr/sbin/zerofree", X_OK); + return r == 0; +} + +int +do_zerofree (const char *device) { char *err; int r; - IS_DEVICE (device, -1); - r = command (NULL, &err, "/usr/sbin/zerofree", device, NULL); if (r == -1) { reply_with_error ("zerofree: %s: %s", device, err);