X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Ffallocate.c;h=494743075854fd814555535592c2a3c3fd07d6be;hb=9edf52f81dafa574832a2ec3ea57084500b79069;hp=7f17f8b85d6824dba4e9604468a682bec93ad2bc;hpb=e9c37113104c1cfb234535adc9b52ad3880a41ce;p=libguestfs.git diff --git a/daemon/fallocate.c b/daemon/fallocate.c index 7f17f8b..4947430 100644 --- a/daemon/fallocate.c +++ b/daemon/fallocate.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "daemon.h" #include "actions.h" @@ -41,10 +42,9 @@ do_fallocate (const char *path, int len) } #ifdef HAVE_POSIX_FALLOCATE - int r; - - r = posix_fallocate (fd, 0, len); - if (r == -1) { + int err = posix_fallocate (fd, 0, len); + if (err != 0) { + errno = err; reply_with_perror ("%s", path); close (fd); return -1;