X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fswap.c;h=580482fce4ae0bf1441b8c47aef3a9c53466c0f2;hb=6bda071b5cd8393b37653687027c4ae6c6cf3804;hp=c9104e1d0281fc03e23628f398955c40d9e25b23;hpb=1997858e90da728287ef26a6d01a5766ac914312;p=libguestfs.git diff --git a/daemon/swap.c b/daemon/swap.c index c9104e1..580482f 100644 --- a/daemon/swap.c +++ b/daemon/swap.c @@ -52,24 +52,18 @@ mkswap (char *device, const char *flag, const char *value) int do_mkswap (char *device) { - RESOLVE_DEVICE (device, return -1); - return mkswap (device, NULL, NULL); } int do_mkswap_L (char *label, char *device) { - RESOLVE_DEVICE (device, return -1); - return mkswap (device, "-L", label); } int do_mkswap_U (char *uuid, char *device) { - RESOLVE_DEVICE (device, return -1); - return mkswap (device, "-U", uuid); } @@ -79,8 +73,8 @@ do_mkswap_file (char *path) char *buf; int r; - NEED_ROOT (-1); - ABS_PATH (path, -1); + NEED_ROOT (return -1); + ABS_PATH (path, return -1); buf = sysroot_path (path); if (!buf) { @@ -118,16 +112,12 @@ swaponoff (const char *cmd, const char *flag, const char *value) int do_swapon_device (char *device) { - RESOLVE_DEVICE (device, return -1); - return swaponoff ("/sbin/swapon", NULL, device); } int do_swapoff_device (char *device) { - RESOLVE_DEVICE (device, return -1); - return swaponoff ("/sbin/swapoff", NULL, device); } @@ -137,8 +127,8 @@ do_swapon_file (char *path) char *buf; int r; - NEED_ROOT (-1); - ABS_PATH (path, -1); + NEED_ROOT (return -1); + ABS_PATH (path, return -1); buf = sysroot_path (path); if (!buf) { @@ -157,8 +147,8 @@ do_swapoff_file (char *path) char *buf; int r; - NEED_ROOT (-1); - ABS_PATH (path, -1); + NEED_ROOT (return -1); + ABS_PATH (path, return -1); buf = sysroot_path (path); if (!buf) {