From: Sami Kerola Date: Sat, 13 Apr 2013 19:54:46 +0000 (+0100) Subject: partx: check writing to a file descriptor was successful X-Git-Tag: v2.24-rc1~594 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8387429006e14d8e9b71e0fb34128921ed8f3b2a;p=thirdparty%2Futil-linux.git partx: check writing to a file descriptor was successful Signed-off-by: Sami Kerola --- diff --git a/disk-utils/partx.c b/disk-utils/partx.c index 49ef1dc84a..b93ddf3efe 100644 --- a/disk-utils/partx.c +++ b/disk-utils/partx.c @@ -987,6 +987,8 @@ int main(int argc, char **argv) if (loopdev) loopcxt_deinit(&lc); - close(fd); + if (close_fd(fd) != 0) + err(EXIT_FAILURE, _("write failed")); + return rc ? EXIT_FAILURE : EXIT_SUCCESS; }