summaryrefslogtreecommitdiffstats
path: root/gettext-runtime/src/ngettext.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2003-09-15 19:06:16 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:10:59 +0200
commitd5d1ae3b3c3ae2f837740e5f5d65326197ccdb98 (patch)
tree8fbe45763c2c1849a39b9d5e391ed100aa9e28c2 /gettext-runtime/src/ngettext.c
parent3f0ee8caa6c510ac4b025e56958c69734282ca8f (diff)
downloadexternal_gettext-d5d1ae3b3c3ae2f837740e5f5d65326197ccdb98.zip
external_gettext-d5d1ae3b3c3ae2f837740e5f5d65326197ccdb98.tar.gz
external_gettext-d5d1ae3b3c3ae2f837740e5f5d65326197ccdb98.tar.bz2
Check for write error on stdout when the program exits.
Diffstat (limited to 'gettext-runtime/src/ngettext.c')
-rw-r--r--gettext-runtime/src/ngettext.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gettext-runtime/src/ngettext.c b/gettext-runtime/src/ngettext.c
index 654a347..8e6b03f 100644
--- a/gettext-runtime/src/ngettext.c
+++ b/gettext-runtime/src/ngettext.c
@@ -26,6 +26,7 @@
#include <locale.h>
#include <errno.h>
+#include "closeout.h"
#include "error.h"
#include "progname.h"
#include "relocatable.h"
@@ -86,6 +87,9 @@ main (int argc, char *argv[])
bindtextdomain (PACKAGE, relocate (LOCALEDIR));
textdomain (PACKAGE);
+ /* Ensure that write errors on stdout are detected. */
+ atexit (close_stdout);
+
/* Parse command line options. */
while ((optchar = getopt_long (argc, argv, "+d:eEhV", long_options, NULL))
!= EOF)