aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-10-24 22:08:00 +0300
committerArnold D. Robbins <arnold@skeeve.com>2013-10-24 22:08:00 +0300
commit38bd2eff2ea99abb535ee5d2bd14f2b7b2c303de (patch)
tree5d4c774e87954166bc5c8fcfddeaba370f5a5c63 /io.c
parent0307bffa31f7c7b51531bd74b730c035c8f1dfa1 (diff)
parent29e3ae329c550b884169b7db20775cd74b95b77a (diff)
downloadegawk-38bd2eff2ea99abb535ee5d2bd14f2b7b2c303de.tar.gz
egawk-38bd2eff2ea99abb535ee5d2bd14f2b7b2c303de.tar.bz2
egawk-38bd2eff2ea99abb535ee5d2bd14f2b7b2c303de.zip
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'io.c')
-rw-r--r--io.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/io.c b/io.c
index e0632d8b..3daadb32 100644
--- a/io.c
+++ b/io.c
@@ -1261,12 +1261,15 @@ flush_io()
int status = 0;
errno = 0;
+ /* we don't warn about stdout/stderr if EPIPE, but we do error exit */
if (fflush(stdout)) {
- warning(_("error writing standard output (%s)"), strerror(errno));
+ if (errno != EPIPE)
+ warning(_("error writing standard output (%s)"), strerror(errno));
status++;
}
if (fflush(stderr)) {
- warning(_("error writing standard error (%s)"), strerror(errno));
+ if (errno != EPIPE)
+ warning(_("error writing standard error (%s)"), strerror(errno));
status++;
}
for (rp = red_head; rp != NULL; rp = rp->next)
@@ -1316,13 +1319,16 @@ close_io(bool *stdio_problem)
* them, we just flush them, and do that across the board.
*/
*stdio_problem = false;
- if (fflush(stdout)) {
- warning(_("error writing standard output (%s)"), strerror(errno));
+ /* we don't warn about stdout/stderr if EPIPE, but we do error exit */
+ if (fflush(stdout) != 0) {
+ if (errno != EPIPE)
+ warning(_("error writing standard output (%s)"), strerror(errno));
status++;
*stdio_problem = true;
}
- if (fflush(stderr)) {
- warning(_("error writing standard error (%s)"), strerror(errno));
+ if (fflush(stderr) != 0) {
+ if (errno != EPIPE)
+ warning(_("error writing standard error (%s)"), strerror(errno));
status++;
*stdio_problem = true;
}