summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'daemon')
-rw-r--r--daemon/augeas.c4
-rw-r--r--daemon/checksum.c2
-rw-r--r--daemon/cmp.c4
-rw-r--r--daemon/cpmv.c4
-rw-r--r--daemon/dir.c12
-rw-r--r--daemon/du.c2
-rw-r--r--daemon/fallocate.c2
-rw-r--r--daemon/file.c20
-rw-r--r--daemon/find.c2
-rw-r--r--daemon/glob.c2
-rw-r--r--daemon/grep.c2
-rw-r--r--daemon/grub.c2
-rw-r--r--daemon/headtail.c2
-rw-r--r--daemon/hexdump.c2
-rw-r--r--daemon/initrd.c2
-rw-r--r--daemon/inotify.c2
-rw-r--r--daemon/link.c4
-rw-r--r--daemon/ls.c2
-rw-r--r--daemon/mknod.c2
-rw-r--r--daemon/mount.c6
-rw-r--r--daemon/readdir.c2
-rw-r--r--daemon/realpath.c2
-rw-r--r--daemon/scrub.c4
-rw-r--r--daemon/stat.c6
-rw-r--r--daemon/strings.c2
-rw-r--r--daemon/swap.c6
-rw-r--r--daemon/tar.c4
-rw-r--r--daemon/wc.c2
-rw-r--r--daemon/xattr.c2
29 files changed, 55 insertions, 55 deletions
diff --git a/daemon/augeas.c b/daemon/augeas.c
index 79d41a46..45f86cf9 100644
--- a/daemon/augeas.c
+++ b/daemon/augeas.c
@@ -55,7 +55,7 @@ do_aug_init (char *root, int flags)
char *buf;
NEED_ROOT (-1);
- ABS_PATH (root, -1);
+ ABS_PATH (root, return -1);
if (aug) {
aug_close (aug);
@@ -350,7 +350,7 @@ do_aug_ls (char *path)
NEED_AUG (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
len = strlen (path);
diff --git a/daemon/checksum.c b/daemon/checksum.c
index bd71182a..d12413f5 100644
--- a/daemon/checksum.c
+++ b/daemon/checksum.c
@@ -37,7 +37,7 @@ do_checksum (char *csumtype, char *path)
int len;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
if (strcasecmp (csumtype, "crc") == 0)
program = "cksum";
diff --git a/daemon/cmp.c b/daemon/cmp.c
index a2d92a33..30574e2c 100644
--- a/daemon/cmp.c
+++ b/daemon/cmp.c
@@ -35,8 +35,8 @@ do_equal (char *file1, char *file2)
int r;
NEED_ROOT (-1);
- ABS_PATH (file1, -1);
- ABS_PATH (file2, -1);
+ ABS_PATH (file1, return -1);
+ ABS_PATH (file2, return -1);
file1buf = sysroot_path (file1);
if (file1buf == NULL) {
diff --git a/daemon/cpmv.c b/daemon/cpmv.c
index 289a2dab..37f1219f 100644
--- a/daemon/cpmv.c
+++ b/daemon/cpmv.c
@@ -53,8 +53,8 @@ cpmv_cmd (const char *cmd, const char *flags, const char *src, const char *dest)
int r;
NEED_ROOT (-1);
- ABS_PATH (src, -1);
- ABS_PATH (dest, -1);
+ ABS_PATH (src, return -1);
+ ABS_PATH (dest, return -1);
srcbuf = sysroot_path (src);
if (srcbuf == NULL) {
diff --git a/daemon/dir.c b/daemon/dir.c
index 5945862e..20cbd243 100644
--- a/daemon/dir.c
+++ b/daemon/dir.c
@@ -35,7 +35,7 @@ do_rmdir (char *path)
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = rmdir (path);
@@ -60,7 +60,7 @@ do_rm_rf (char *path)
char *buf, *err;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
if (strcmp (path, "/") == 0) {
reply_with_error ("rm -rf: cannot remove root directory");
@@ -94,7 +94,7 @@ do_mkdir (char *path)
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = mkdir (path, 0777);
@@ -160,7 +160,7 @@ do_mkdir_p (char *path)
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = recursive_mkdir (path);
@@ -181,7 +181,7 @@ do_is_dir (char *path)
struct stat buf;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = lstat (path, &buf);
@@ -205,7 +205,7 @@ do_mkdtemp (char *template)
char *r;
NEED_ROOT (NULL);
- ABS_PATH (template, NULL);
+ ABS_PATH (template, return NULL);
CHROOT_IN;
r = mkdtemp (template);
diff --git a/daemon/du.c b/daemon/du.c
index 735132ae..7d9c663d 100644
--- a/daemon/du.c
+++ b/daemon/du.c
@@ -37,7 +37,7 @@ do_du (char *path)
char *buf;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
/* Make the path relative to /sysroot. */
buf = sysroot_path (path);
diff --git a/daemon/fallocate.c b/daemon/fallocate.c
index 47e84c69..f61c496e 100644
--- a/daemon/fallocate.c
+++ b/daemon/fallocate.c
@@ -33,7 +33,7 @@ do_fallocate (char *path, int len)
int fd, r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
fd = open (path, O_WRONLY | O_CREAT | O_TRUNC | O_NOCTTY, 0666);
diff --git a/daemon/file.c b/daemon/file.c
index d2ada997..e1851329 100644
--- a/daemon/file.c
+++ b/daemon/file.c
@@ -36,7 +36,7 @@ do_touch (char *path)
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
fd = open (path, O_WRONLY | O_CREAT | O_NOCTTY, 0666);
@@ -148,7 +148,7 @@ do_read_lines (char *path)
ssize_t n;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
fp = fopen (path, "r");
@@ -195,7 +195,7 @@ do_rm (char *path)
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = unlink (path);
@@ -215,7 +215,7 @@ do_chmod (int mode, char *path)
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = chmod (path, mode);
@@ -235,7 +235,7 @@ do_chown (int owner, int group, char *path)
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = chown (path, owner, group);
@@ -255,7 +255,7 @@ do_exists (char *path)
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = access (path, F_OK);
@@ -271,7 +271,7 @@ do_is_file (char *path)
struct stat buf;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = lstat (path, &buf);
@@ -295,7 +295,7 @@ do_write_file (char *path, char *content, int size)
int fd;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
if (size == 0)
size = strlen (content);
@@ -331,7 +331,7 @@ do_read_file (char *path, size_t *size_r)
char *r;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
fd = open (path, O_RDONLY);
@@ -445,7 +445,7 @@ do_zfile (char *method, char *path)
char line[256];
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
if (strcmp (method, "gzip") == 0 || strcmp (method, "compress") == 0)
zcat = "zcat";
diff --git a/daemon/find.c b/daemon/find.c
index 40f1b3bc..c514177a 100644
--- a/daemon/find.c
+++ b/daemon/find.c
@@ -60,7 +60,7 @@ do_find (char *dir)
char str[PATH_MAX];
NEED_ROOT (NULL);
- ABS_PATH (dir, NULL);
+ ABS_PATH (dir, return NULL);
sysrootdir = sysroot_path (dir);
if (!sysrootdir) {
diff --git a/daemon/glob.c b/daemon/glob.c
index f15d5e50..1c47ba51 100644
--- a/daemon/glob.c
+++ b/daemon/glob.c
@@ -32,7 +32,7 @@ do_glob_expand (char *pattern)
glob_t buf;
NEED_ROOT (NULL);
- ABS_PATH (pattern, NULL); /* Required so chroot can be used. */
+ ABS_PATH (pattern, return NULL); /* Required so chroot can be used. */
/* glob(3) in glibc never calls chdir, so this seems to be safe: */
CHROOT_IN;
diff --git a/daemon/grep.c b/daemon/grep.c
index c51dc0b8..19e4683d 100644
--- a/daemon/grep.c
+++ b/daemon/grep.c
@@ -36,7 +36,7 @@ grep (const char *prog, const char *flag, char *regex, char *path)
char **lines;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
/* Make the path relative to /sysroot. */
buf = sysroot_path (path);
diff --git a/daemon/grub.c b/daemon/grub.c
index 118771fa..8fcd911d 100644
--- a/daemon/grub.c
+++ b/daemon/grub.c
@@ -33,7 +33,7 @@ do_grub_install (char *root, char *device)
char *buf;
NEED_ROOT (-1);
- ABS_PATH (root, -1);
+ ABS_PATH (root, return -1);
RESOLVE_DEVICE (device, return -1);
if (asprintf_nowarn (&buf, "--root-directory=%R", root) == -1) {
diff --git a/daemon/headtail.c b/daemon/headtail.c
index af2648cc..bdd0f490 100644
--- a/daemon/headtail.c
+++ b/daemon/headtail.c
@@ -36,7 +36,7 @@ headtail (const char *prog, const char *flag, const char *n, char *path)
char **lines;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
/* Make the path relative to /sysroot. */
buf = sysroot_path (path);
diff --git a/daemon/hexdump.c b/daemon/hexdump.c
index e2d8300e..27ea108d 100644
--- a/daemon/hexdump.c
+++ b/daemon/hexdump.c
@@ -33,7 +33,7 @@ do_hexdump (char *path)
char *out, *err;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
buf = sysroot_path (path);
if (!buf) {
diff --git a/daemon/initrd.c b/daemon/initrd.c
index 59749bba..e7034817 100644
--- a/daemon/initrd.c
+++ b/daemon/initrd.c
@@ -38,7 +38,7 @@ do_initrd_list (char *path)
size_t len;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
/* "zcat /sysroot/<path> | cpio --quiet -it", but path must be quoted. */
if (asprintf_nowarn (&cmd, "zcat %R | cpio --quiet -it", path) == -1) {
diff --git a/daemon/inotify.c b/daemon/inotify.c
index 8bb8ed2b..2f22f52c 100644
--- a/daemon/inotify.c
+++ b/daemon/inotify.c
@@ -129,7 +129,7 @@ do_inotify_add_watch (char *path, int mask)
char *buf;
NEED_INOTIFY (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
buf = sysroot_path (path);
if (!buf) {
diff --git a/daemon/link.c b/daemon/link.c
index 29ae6794..bf616ed8 100644
--- a/daemon/link.c
+++ b/daemon/link.c
@@ -35,7 +35,7 @@ do_readlink (char *path)
char link[PATH_MAX];
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
r = readlink (path, link, sizeof link);
@@ -63,7 +63,7 @@ _link (const char *flag, int symbolic, const char *target, const char *linkname)
char *buf_target;
NEED_ROOT (-1);
- ABS_PATH (linkname, -1);
+ ABS_PATH (linkname, return -1);
/* but target does not need to be absolute */
/* Prefix linkname with sysroot. */
diff --git a/daemon/ls.c b/daemon/ls.c
index e2ca55f8..8ae150b4 100644
--- a/daemon/ls.c
+++ b/daemon/ls.c
@@ -38,7 +38,7 @@ do_ls (char *path)
struct dirent *d;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
dir = opendir (path);
diff --git a/daemon/mknod.c b/daemon/mknod.c
index 315ea7df..ab799cd1 100644
--- a/daemon/mknod.c
+++ b/daemon/mknod.c
@@ -36,7 +36,7 @@ do_mknod (int mode, int devmajor, int devminor, char *path)
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = mknod (path, mode, makedev (devmajor, devminor));
diff --git a/daemon/mount.c b/daemon/mount.c
index 6c30304e..8cf68749 100644
--- a/daemon/mount.c
+++ b/daemon/mount.c
@@ -320,7 +320,7 @@ do_mount_loop (char *file, char *mountpoint)
char *error;
NEED_ROOT (-1);
- ABS_PATH (file, -1);
+ ABS_PATH (file, return -1);
/* We have to prefix /sysroot on both the filename and the mountpoint. */
mp = sysroot_path (mountpoint);
@@ -358,7 +358,7 @@ do_mkmountpoint (char *path)
int r;
/* NEED_ROOT (-1); - we don't want this test for this call. */
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = mkdir (path, 0777);
@@ -383,7 +383,7 @@ do_rmmountpoint (char *path)
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = rmdir (path);
diff --git a/daemon/readdir.c b/daemon/readdir.c
index 17fc6190..f8f95d26 100644
--- a/daemon/readdir.c
+++ b/daemon/readdir.c
@@ -37,7 +37,7 @@ do_readdir (char *path)
int i;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
ret = malloc (sizeof *ret);
if (ret == NULL) {
diff --git a/daemon/realpath.c b/daemon/realpath.c
index 9ab478d2..18adc85e 100644
--- a/daemon/realpath.c
+++ b/daemon/realpath.c
@@ -33,7 +33,7 @@ do_realpath (char *path)
char *ret;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
ret = realpath (path, NULL);
diff --git a/daemon/scrub.c b/daemon/scrub.c
index 3c22b663..f1601f9f 100644
--- a/daemon/scrub.c
+++ b/daemon/scrub.c
@@ -55,7 +55,7 @@ do_scrub_file (char *file)
int r;
NEED_ROOT (-1);
- ABS_PATH (file, -1);
+ ABS_PATH (file, return -1);
/* Make the path relative to /sysroot. */
buf = sysroot_path (file);
@@ -85,7 +85,7 @@ do_scrub_freespace (char *dir)
int r;
NEED_ROOT (-1);
- ABS_PATH (dir, -1);
+ ABS_PATH (dir, return -1);
/* Make the path relative to /sysroot. */
buf = sysroot_path (dir);
diff --git a/daemon/stat.c b/daemon/stat.c
index da360ce8..da2d2740 100644
--- a/daemon/stat.c
+++ b/daemon/stat.c
@@ -38,7 +38,7 @@ do_stat (char *path)
struct stat statbuf;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
r = stat (path, &statbuf);
@@ -80,7 +80,7 @@ do_lstat (char *path)
struct stat statbuf;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
r = lstat (path, &statbuf);
@@ -122,7 +122,7 @@ do_statvfs (char *path)
struct statvfs statbuf;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
r = statvfs (path, &statbuf);
diff --git a/daemon/strings.c b/daemon/strings.c
index c0e073fe..89e04a8b 100644
--- a/daemon/strings.c
+++ b/daemon/strings.c
@@ -34,7 +34,7 @@ do_strings_e (char *encoding, char *path)
char **lines;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
buf = sysroot_path (path);
if (!buf) {
diff --git a/daemon/swap.c b/daemon/swap.c
index c9104e1d..bb1706fa 100644
--- a/daemon/swap.c
+++ b/daemon/swap.c
@@ -80,7 +80,7 @@ do_mkswap_file (char *path)
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
buf = sysroot_path (path);
if (!buf) {
@@ -138,7 +138,7 @@ do_swapon_file (char *path)
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
buf = sysroot_path (path);
if (!buf) {
@@ -158,7 +158,7 @@ do_swapoff_file (char *path)
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
buf = sysroot_path (path);
if (!buf) {
diff --git a/daemon/tar.c b/daemon/tar.c
index 39b983c0..e1ff9b6d 100644
--- a/daemon/tar.c
+++ b/daemon/tar.c
@@ -107,7 +107,7 @@ do_tar_out (char *dir)
char buf[GUESTFS_MAX_CHUNK_SIZE];
NEED_ROOT (-1);
- ABS_PATH (dir, -1);
+ ABS_PATH (dir, return -1);
/* "tar -C /sysroot%s -cf - ." but we have to quote the dir. */
if (asprintf_nowarn (&cmd, "tar -C %R -cf - .", dir) == -1) {
@@ -229,7 +229,7 @@ do_tgz_out (char *dir)
char buf[GUESTFS_MAX_CHUNK_SIZE];
NEED_ROOT (-1);
- ABS_PATH (dir, -1);
+ ABS_PATH (dir, return -1);
/* "tar -C /sysroot%s -zcf - ." but we have to quote the dir. */
if (asprintf_nowarn (&cmd, "tar -C %R -zcf - .", dir) == -1) {
diff --git a/daemon/wc.c b/daemon/wc.c
index 4878b57e..0917eb9b 100644
--- a/daemon/wc.c
+++ b/daemon/wc.c
@@ -35,7 +35,7 @@ wc (char *flag, char *path)
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
/* Make the path relative to /sysroot. */
buf = sysroot_path (path);
diff --git a/daemon/xattr.c b/daemon/xattr.c
index a908a44b..88947b22 100644
--- a/daemon/xattr.c
+++ b/daemon/xattr.c
@@ -117,7 +117,7 @@ getxattrs (char *path,
guestfs_int_xattr_list *r = NULL;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
len = listxattr (path, NULL, 0);