diff options
author | Sami Kerola | 2013-04-13 21:54:46 +0200 |
---|---|---|
committer | Karel Zak | 2013-04-26 13:26:06 +0200 |
commit | 8387429006e14d8e9b71e0fb34128921ed8f3b2a (patch) | |
tree | d8000cea471ef1f0ff2fac9ea9249070f2806b64 /disk-utils/partx.c | |
parent | fdformat: check writing to a file descriptor was successful (diff) | |
download | kernel-qcow2-util-linux-8387429006e14d8e9b71e0fb34128921ed8f3b2a.tar.gz kernel-qcow2-util-linux-8387429006e14d8e9b71e0fb34128921ed8f3b2a.tar.xz kernel-qcow2-util-linux-8387429006e14d8e9b71e0fb34128921ed8f3b2a.zip |
partx: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'disk-utils/partx.c')
-rw-r--r-- | disk-utils/partx.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/disk-utils/partx.c b/disk-utils/partx.c index 49ef1dc84..b93ddf3ef 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; } |