[PATCH 17/33] fdformat: check writing to a file descriptor was successful

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

 



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

diff --git a/disk-utils/fdformat.c b/disk-utils/fdformat.c
index 509a605..b50ba30 100644
--- a/disk-utils/fdformat.c
+++ b/disk-utils/fdformat.c
@@ -159,7 +159,8 @@ int main(int argc, char **argv)
 	       (param.head == 2) ? _("Double") : _("Single"),
 	       param.track, param.sect, param.size >> 1);
 	format_disk(ctrl);
-	close(ctrl);
+	if (close_fd(ctrl) != 0)
+		err(EXIT_FAILURE, _("write failed"));
 
 	if (verify)
 		verify_disk(argv[0]);
-- 
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