summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Kerola2012-04-04 20:01:07 +0200
committerSami Kerola2012-04-04 20:01:07 +0200
commit3862f68538b0f62ff448fa9c20b8fcfb948deeb1 (patch)
tree95d2d28ea6c548be5461be36823de80ddf75043b
parenthwclock: verify writing to streams was successful (diff)
downloadkernel-qcow2-util-linux-3862f68538b0f62ff448fa9c20b8fcfb948deeb1.tar.gz
kernel-qcow2-util-linux-3862f68538b0f62ff448fa9c20b8fcfb948deeb1.tar.xz
kernel-qcow2-util-linux-3862f68538b0f62ff448fa9c20b8fcfb948deeb1.zip
getopt: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r--getopt/getopt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/getopt/getopt.c b/getopt/getopt.c
index 51ff19e95..4e5043aaa 100644
--- a/getopt/getopt.c
+++ b/getopt/getopt.c
@@ -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;