]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Make cldr-plurals program more robust.
authorBruno Haible <bruno@clisp.org>
Sun, 6 Jan 2019 21:58:31 +0000 (22:58 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 6 Jan 2019 21:58:31 +0000 (22:58 +0100)
* gettext-tools/src/cldr-plurals.c: Include closeout.h.
(main): Arrange to invoke close_stdout at program exit.

gettext-tools/src/cldr-plurals.c

index e8228cdb58f8956a50893053424a1c96e22e5e26..c3cfea9288afd6d3bc7ad5d716fd6ecf5b1a2483 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "basename.h"
 #include "cldr-plural-exp.h"
+#include "closeout.h"
 #include "c-ctype.h"
 #include <errno.h>
 #include <error.h>
@@ -255,6 +256,9 @@ main (int argc, char **argv)
   bindtextdomain ("bison-runtime", relocate (BISON_LOCALEDIR));
   textdomain (PACKAGE);
 
+  /* Ensure that write errors on stdout are detected.  */
+  atexit (close_stdout);
+
   while ((optchar = getopt_long (argc, argv, "chV", long_options, NULL)) != EOF)
     switch (optchar)
       {