From: Bruno Haible Date: Sun, 6 Jan 2019 21:58:31 +0000 (+0100) Subject: Make cldr-plurals program more robust. X-Git-Tag: v0.20~189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2c9c39947d23410b0cf0cb4e0579c6da5dea2e8;p=thirdparty%2Fgettext.git Make cldr-plurals program more robust. * gettext-tools/src/cldr-plurals.c: Include closeout.h. (main): Arrange to invoke close_stdout at program exit. --- diff --git a/gettext-tools/src/cldr-plurals.c b/gettext-tools/src/cldr-plurals.c index e8228cdb5..c3cfea928 100644 --- a/gettext-tools/src/cldr-plurals.c +++ b/gettext-tools/src/cldr-plurals.c @@ -22,6 +22,7 @@ #include "basename.h" #include "cldr-plural-exp.h" +#include "closeout.h" #include "c-ctype.h" #include #include @@ -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) {