]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
partx: verify writing to streams was successful
authorSami Kerola <kerolasa@iki.fi>
Wed, 4 Apr 2012 17:53:13 +0000 (19:53 +0200)
committerSami Kerola <kerolasa@iki.fi>
Wed, 4 Apr 2012 17:53:13 +0000 (19:53 +0200)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
partx/partx.c

index 0c46af6ebfc2aca290a2d800e1dc2d35bc7326f2..f19b9192846d6b889fbdd2c40375fd29788c2279 100644 (file)
@@ -33,6 +33,7 @@
 #include "sysfs.h"
 #include "loopdev.h"
 #include "at.h"
+#include "closestream.h"
 
 /* this is the default upper limit, could be modified by --nr */
 #define SLICES_MAX     256
@@ -667,6 +668,7 @@ int main(int argc, char **argv)
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
+       atexit(close_stdout);
 
        while ((c = getopt_long(argc, argv,
                                "abdglrsvn:t:o:PhV", long_opts, NULL)) != -1) {