X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Ffile.c;h=cd477e5e4db146cb618b5c81e2510e89cb2aa20c;hb=2361905686c62b4163232139c3d390acd2c07916;hp=6062c50d55fbc277f328a71eb849ac6298ab54f7;hpb=0f2e9c84e9ff1071260770930068642ecc8ac0d9;p=libguestfs.git diff --git a/daemon/file.c b/daemon/file.c index 6062c50..cd477e5 100644 --- a/daemon/file.c +++ b/daemon/file.c @@ -97,18 +97,18 @@ do_cat (char *path) if (size >= alloc) { alloc += 8192; if (alloc > max) { - reply_with_error ("cat: %s: file is too large for message buffer", - path); - free (buf); - close (fd); - return NULL; + reply_with_error ("cat: %s: file is too large for message buffer", + path); + free (buf); + close (fd); + return NULL; } buf2 = realloc (buf, alloc); if (buf2 == NULL) { - reply_with_perror ("realloc"); - free (buf); - close (fd); - return NULL; + reply_with_perror ("realloc"); + free (buf); + close (fd); + return NULL; } buf = buf2; } @@ -392,7 +392,6 @@ do_file (char *path) int len; NEED_ROOT_OR_IS_DEVICE (path, NULL); - ABS_PATH (path, NULL); if (strncmp (path, "/dev/", 5) == 0) buf = (char *) path; @@ -416,7 +415,7 @@ do_file (char *path) return NULL; } - r = command (&out, &err, "file", "-bsL", buf, NULL); + r = command (&out, &err, "file", "-zbsL", buf, NULL); if (freeit) free (buf); if (r == -1) {