[PATCH 27/33] mkfs.minix: check writing to a file descriptor was successful

Sami Kerola
2013-04-13T19:56:23Z

disk-utils/mkfs.minix.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c
index e80d1d6..3a1617b 100644
--- a/disk-utils/mkfs.minix.c
+++ b/disk-utils/mkfs.minix.c
@@ -804,7 +804,8 @@ int main(int argc, char ** argv) {

mark_good_blocks();
write_tables();
- close(DEV);
+ if (close_fd(DEV) != 0)
+ err(MKFS_EX_ERROR, _("write failed"));

return MKFS_EX_OK;
}
--
1.8.2.1