[PATCH 18/33] partx: check writing to a file descriptor was successful

Sami Kerola
2013-04-13T19:55:58Z

disk-utils/partx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/disk-utils/partx.c b/disk-utils/partx.c
index 49ef1dc..b93ddf3 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;
}
--
1.8.2.1