From: Sami Kerola Date: Sat, 13 Apr 2013 19:54:45 +0000 (+0100) Subject: fdformat: check writing to a file descriptor was successful X-Git-Tag: v2.24-rc1~595 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5efee9d4144752be924e29db03c55a8ae26c6c5b;p=thirdparty%2Futil-linux.git fdformat: check writing to a file descriptor was successful Signed-off-by: Sami Kerola --- diff --git a/disk-utils/fdformat.c b/disk-utils/fdformat.c index 509a6055b9..b50ba30188 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]);