From: Sami Kerola Date: Sat, 13 Apr 2013 19:54:58 +0000 (+0100) Subject: fallocate: check writing to a file descriptor was successful X-Git-Tag: v2.24-rc1~582 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f52af507b9ab1799f39b80d5561266ad02216b9;p=thirdparty%2Futil-linux.git fallocate: check writing to a file descriptor was successful Signed-off-by: Sami Kerola --- diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c index ff0f9e6e1d..6a876736a3 100644 --- a/sys-utils/fallocate.c +++ b/sys-utils/fallocate.c @@ -168,6 +168,7 @@ int main(int argc, char **argv) err(EXIT_FAILURE, _("%s: fallocate failed"), fname); } - close(fd); + if (close_fd(fd) != 0) + err(EXIT_FAILURE, _("write failed: %s"), fname); return EXIT_SUCCESS; }