From 5f52af507b9ab1799f39b80d5561266ad02216b9 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 13 Apr 2013 20:54:58 +0100 Subject: fallocate: check writing to a file descriptor was successful Signed-off-by: Sami Kerola --- sys-utils/fallocate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys-utils/fallocate.c') diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c index ff0f9e6e1..6a876736a 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; } -- cgit v1.2.3-55-g7522