X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=daemon%2Faugeas.c;h=b6cc8f00057154f4349a8f56e5b210681cbc431b;hb=6bda071b5cd8393b37653687027c4ae6c6cf3804;hp=f75a1d6fc1862df71b3d0a84d3b311d71621e605;hpb=d5532e9ad29b28c2b323ad0abe4e0caa6e03f675;p=libguestfs.git diff --git a/daemon/augeas.c b/daemon/augeas.c index f75a1d6..b6cc8f0 100644 --- a/daemon/augeas.c +++ b/daemon/augeas.c @@ -53,23 +53,20 @@ do_aug_init (char *root, int flags) { #ifdef HAVE_AUGEAS char *buf; - int len; - NEED_ROOT (-1); - ABS_PATH (root, -1); + NEED_ROOT (return -1); + ABS_PATH (root, return -1); if (aug) { aug_close (aug); aug = NULL; } - len = strlen (root) + 9; - buf = malloc (len); + buf = sysroot_path (root); if (!buf) { reply_with_perror ("malloc"); return -1; } - snprintf (buf, len, "/sysroot%s", root); aug = aug_init (buf, NULL, flags); free (buf); @@ -353,7 +350,7 @@ do_aug_ls (char *path) NEED_AUG (NULL); - ABS_PATH (path, NULL); + ABS_PATH (path, return NULL); len = strlen (path);