X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fheadtail.c;h=af2648cc7940f8bc4b47fac388faeeffc9736036;hp=b522c55f15d58ddc033b4b1f7f67eef6625d01c2;hb=ad7497c533cc5c24f667104bebbfa5f6dda8c8f6;hpb=3854bbdecd1c089959fb812a739b84a96c05fbbf diff --git a/daemon/headtail.c b/daemon/headtail.c index b522c55..af2648c 100644 --- a/daemon/headtail.c +++ b/daemon/headtail.c @@ -1,5 +1,5 @@ /* libguestfs - the guestfsd daemon - * Copyright (C) 2009 Red Hat Inc. + * Copyright (C) 2009 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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);