summaryrefslogtreecommitdiffstats
path: root/gettext-tools/src/write-po.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-tools/src/write-po.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-tools/src/write-po.c')
-rw-r--r--gettext-tools/src/write-po.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gettext-tools/src/write-po.c b/gettext-tools/src/write-po.c
index 9120f21..985179e 100644
--- a/gettext-tools/src/write-po.c
+++ b/gettext-tools/src/write-po.c
@@ -1094,7 +1094,9 @@ msgdomain_list_print (msgdomain_list_ty *mdlp, const char *filename,
if (fflush (fp) || ferror (fp))
error (EXIT_FAILURE, errno, _("error while writing \"%s\" file"),
filename);
- fclose (fp);
+
+ if (fp != stdout)
+ fclose (fp);
}