char *buf;
NEED_ROOT (-1);
- ABS_PATH (root, -1);
+ ABS_PATH (root, return -1);
if (aug) {
aug_close (aug);
NEED_AUG (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
len = strlen (path);
int len;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
if (strcasecmp (csumtype, "crc") == 0)
program = "cksum";
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) {
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) {
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = rmdir (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");
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = mkdir (path, 0777);
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = recursive_mkdir (path);
struct stat buf;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = lstat (path, &buf);
char *r;
NEED_ROOT (NULL);
- ABS_PATH (template, NULL);
+ ABS_PATH (template, return NULL);
CHROOT_IN;
r = mkdtemp (template);
char *buf;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
/* Make the path relative to /sysroot. */
buf = sysroot_path (path);
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);
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);
ssize_t n;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
fp = fopen (path, "r");
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = unlink (path);
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = chmod (path, mode);
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = chown (path, owner, group);
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = access (path, F_OK);
struct stat buf;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = lstat (path, &buf);
int fd;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
if (size == 0)
size = strlen (content);
char *r;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
fd = open (path, O_RDONLY);
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";
char str[PATH_MAX];
NEED_ROOT (NULL);
- ABS_PATH (dir, NULL);
+ ABS_PATH (dir, return NULL);
sysrootdir = sysroot_path (dir);
if (!sysrootdir) {
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;
char **lines;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
/* Make the path relative to /sysroot. */
buf = sysroot_path (path);
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) {
char **lines;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
/* Make the path relative to /sysroot. */
buf = sysroot_path (path);
char *out, *err;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
buf = sysroot_path (path);
if (!buf) {
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) {
char *buf;
NEED_INOTIFY (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
buf = sysroot_path (path);
if (!buf) {
char link[PATH_MAX];
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
r = readlink (path, link, sizeof link);
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. */
struct dirent *d;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
dir = opendir (path);
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = mknod (path, mode, makedev (devmajor, devminor));
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);
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);
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = rmdir (path);
int i;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
ret = malloc (sizeof *ret);
if (ret == NULL) {
char *ret;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
ret = realpath (path, NULL);
int r;
NEED_ROOT (-1);
- ABS_PATH (file, -1);
+ ABS_PATH (file, return -1);
/* Make the path relative to /sysroot. */
buf = sysroot_path (file);
int r;
NEED_ROOT (-1);
- ABS_PATH (dir, -1);
+ ABS_PATH (dir, return -1);
/* Make the path relative to /sysroot. */
buf = sysroot_path (dir);
struct stat statbuf;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
r = stat (path, &statbuf);
struct stat statbuf;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
r = lstat (path, &statbuf);
struct statvfs statbuf;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
CHROOT_IN;
r = statvfs (path, &statbuf);
char **lines;
NEED_ROOT (NULL);
- ABS_PATH (path, NULL);
+ ABS_PATH (path, return NULL);
buf = sysroot_path (path);
if (!buf) {
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
buf = sysroot_path (path);
if (!buf) {
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
buf = sysroot_path (path);
if (!buf) {
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
buf = sysroot_path (path);
if (!buf) {
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) {
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) {
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
/* Make the path relative to /sysroot. */
buf = sysroot_path (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);