diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2013-10-24 22:08:00 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2013-10-24 22:08:00 +0300 |
commit | 38bd2eff2ea99abb535ee5d2bd14f2b7b2c303de (patch) | |
tree | 5d4c774e87954166bc5c8fcfddeaba370f5a5c63 /io.c | |
parent | 0307bffa31f7c7b51531bd74b730c035c8f1dfa1 (diff) | |
parent | 29e3ae329c550b884169b7db20775cd74b95b77a (diff) | |
download | egawk-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.c | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -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; } |