diff options
author | Richard Jones <rjones@trick.home.annexia.org> | 2009-07-18 10:43:52 +0100 |
---|---|---|
committer | Richard Jones <rjones@trick.home.annexia.org> | 2009-07-18 10:43:52 +0100 |
commit | 78029b529ad98769685d607230b70f71832d5906 (patch) | |
tree | f103cb7252ccca7efc3e39f4400f961d5972937c /daemon/headtail.c | |
parent | e8c954933b2bfb3bc3ead5a151d49d164f1a8eab (diff) | |
download | libguestfs-78029b529ad98769685d607230b70f71832d5906.tar.gz libguestfs-78029b529ad98769685d607230b70f71832d5906.tar.xz libguestfs-78029b529ad98769685d607230b70f71832d5906.zip |
Make /sysroot path configurable.
Currently /sysroot is hard-coded throughout the daemon code.
This patch turns the path into a variable so that we can change
it in future, for example to allow standalone mode to be implemented.
This patch was tested by running all the C API tests successfully.
Diffstat (limited to 'daemon/headtail.c')
-rw-r--r-- | daemon/headtail.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/daemon/headtail.c b/daemon/headtail.c index 6d248513..af2648cc 100644 --- a/daemon/headtail.c +++ b/daemon/headtail.c @@ -32,20 +32,18 @@ headtail (const char *prog, const char *flag, const char *n, char *path) { char *buf; char *out, *err; - int r, len; + int r; char **lines; NEED_ROOT (NULL); ABS_PATH (path, NULL); /* Make the path relative to /sysroot. */ - len = strlen (path) + 9; - buf = malloc (len); + buf = sysroot_path (path); if (!buf) { reply_with_perror ("malloc"); return NULL; } - snprintf (buf, len, "/sysroot%s", path); r = command (&out, &err, prog, flag, n, buf, NULL); free (buf); |