[PATCH 23/33] fsck.cramfs: check writing to a file descriptor was successful

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

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

diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c
index 5c4b8c4..3c861d5 100644
--- a/disk-utils/fsck.cramfs.c
+++ b/disk-utils/fsck.cramfs.c
@@ -513,7 +513,8 @@ static void do_file(char *path, struct cramfs_inode *i)
if (i->size)
do_uncompress(path, fd, offset, i->size);
if (opt_extract) {
- close(fd);
+ if (close_fd(fd) != 0)
+ err(FSCK_EX_ERROR, _("write failed: %s"), path);
change_file_status(path, i);
}
}
--
1.8.2.1