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

index 51ff19e95b5cd1e13fc0ab9779a809111837915a..4e5043aaa657b56304a16abafa3455b595254342 100644 (file)
@@ -58,6 +58,7 @@
 #include <ctype.h>
 #include <getopt.h>
 
+#include "closestream.h"
 #include "nls.h"
 #include "xalloc.h"
 
@@ -363,6 +364,7 @@ int main(int argc, char *argv[])
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
+       atexit(close_stdout);
 
        init_longopt();
        getopt_long_fp = getopt_long;