From: Sami Kerola Date: Wed, 4 Apr 2012 18:01:07 +0000 (+0200) Subject: getopt: verify writing to streams was successful X-Git-Tag: v2.22-rc1~539^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3862f68538b0f62ff448fa9c20b8fcfb948deeb1;p=thirdparty%2Futil-linux.git getopt: verify writing to streams was successful Signed-off-by: Sami Kerola --- diff --git a/getopt/getopt.c b/getopt/getopt.c index 51ff19e95b..4e5043aaa6 100644 --- a/getopt/getopt.c +++ b/getopt/getopt.c @@ -58,6 +58,7 @@ #include #include +#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;