[PATCH 26/33] mkfs.cramfs: unify write check to a file descriptor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 disk-utils/mkfs.cramfs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/disk-utils/mkfs.cramfs.c b/disk-utils/mkfs.cramfs.c
index b5edb7a..cb3e657 100644
--- a/disk-utils/mkfs.cramfs.c
+++ b/disk-utils/mkfs.cramfs.c
@@ -879,12 +879,11 @@ int main(int argc, char **argv)
 			(long long) fslen_ub, offset);
 
 	written = write(fd, rom_image, offset);
-	close(fd);
-	if (written < 0)
-		err(MKFS_EX_ERROR, _("ROM image"));
 	if (offset != written)
 		errx(MKFS_EX_ERROR, _("ROM image write failed (%zd %zd)"),
 			written, offset);
+	if (close_fd(fd) != 0)
+		err(MKFS_EX_ERROR, _("ROM image"));
 
 	/*
 	 * (These warnings used to come at the start, but they scroll off
-- 
1.8.2.1

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux