X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Falloc.c;h=93cd8afdfe219278241fe70c948939b492e7c486;hb=aa5bd925f1bef1b6b40d3cb058c1c3e2cf129868;hp=28c990f1bd4f69119fe27e8f969b8f4053af7858;hpb=5ebf3a39340696fea0582a58074d22d11247a6e7;p=libguestfs.git diff --git a/fish/alloc.c b/fish/alloc.c index 28c990f..93cd8af 100644 --- a/fish/alloc.c +++ b/fish/alloc.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "fish.h" @@ -55,7 +56,9 @@ do_alloc (const char *cmd, int argc, char *argv[]) } #ifdef HAVE_POSIX_FALLOCATE - if (posix_fallocate (fd, 0, size) == -1) { + int err = posix_fallocate (fd, 0, size); + if (err != 0) { + errno = err; perror ("fallocate"); close (fd); unlink (argv[0]);