git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update all NEED_ROOT uses
[libguestfs.git]
/
daemon
/
swap.c
diff --git
a/daemon/swap.c
b/daemon/swap.c
index
3ebdef6
..
580482f
100644
(file)
--- 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)
{
int
do_mkswap (char *device)
{
- IS_DEVICE (device, -1);
-
return mkswap (device, NULL, NULL);
}
int
do_mkswap_L (char *label, char *device)
{
return mkswap (device, NULL, NULL);
}
int
do_mkswap_L (char *label, char *device)
{
- IS_DEVICE (device, -1);
-
return mkswap (device, "-L", label);
}
int
do_mkswap_U (char *uuid, char *device)
{
return mkswap (device, "-L", label);
}
int
do_mkswap_U (char *uuid, char *device)
{
- IS_DEVICE (device, -1);
-
return mkswap (device, "-U", uuid);
}
return mkswap (device, "-U", uuid);
}
@@
-79,8
+73,8
@@
do_mkswap_file (char *path)
char *buf;
int r;
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) {
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)
{
int
do_swapon_device (char *device)
{
- IS_DEVICE (device, -1);
-
return swaponoff ("/sbin/swapon", NULL, device);
}
int
do_swapoff_device (char *device)
{
return swaponoff ("/sbin/swapon", NULL, device);
}
int
do_swapoff_device (char *device)
{
- IS_DEVICE (device, -1);
-
return swaponoff ("/sbin/swapoff", NULL, device);
}
return swaponoff ("/sbin/swapoff", NULL, device);
}
@@
-137,8
+127,8
@@
do_swapon_file (char *path)
char *buf;
int r;
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) {
buf = sysroot_path (path);
if (!buf) {
@@
-157,8
+147,8
@@
do_swapoff_file (char *path)
char *buf;
int r;
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) {
buf = sysroot_path (path);
if (!buf) {