summaryrefslogtreecommitdiffstats
path: root/sys-utils/fallocate.c
diff options
context:
space:
mode:
authorSami Kerola2013-04-13 21:54:58 +0200
committerKarel Zak2013-04-26 13:26:07 +0200
commit5f52af507b9ab1799f39b80d5561266ad02216b9 (patch)
treed3c265f0aa28a151238ef736e72637fd3f5d05d2 /sys-utils/fallocate.c
parentswaplabel: check writing to a file descriptor was successful (diff)
downloadkernel-qcow2-util-linux-5f52af507b9ab1799f39b80d5561266ad02216b9.tar.gz
kernel-qcow2-util-linux-5f52af507b9ab1799f39b80d5561266ad02216b9.tar.xz
kernel-qcow2-util-linux-5f52af507b9ab1799f39b80d5561266ad02216b9.zip
fallocate: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/fallocate.c')
-rw-r--r--sys-utils/fallocate.c3
1 files changed, 2 insertions, 1 deletions
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;
}