aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2018-06-17 21:53:31 +0300
committerArnold D. Robbins <arnold@skeeve.com>2018-06-17 21:53:31 +0300
commitf59bc1d895b5cc3d0dfad1ced3fc998ba5f7e976 (patch)
treeb25948242fc9b7a7188280b2fa883b19a5354324 /io.c
parent11d1cd05ef84f8dedf79020128ffcb8a9764f3b8 (diff)
parent7f57d12c835729207aea12e22021efce1705e6a0 (diff)
downloadegawk-f59bc1d895b5cc3d0dfad1ced3fc998ba5f7e976.tar.gz
egawk-f59bc1d895b5cc3d0dfad1ced3fc998ba5f7e976.tar.bz2
egawk-f59bc1d895b5cc3d0dfad1ced3fc998ba5f7e976.zip
Merge branch 'master' into feature/fix-comments
Diffstat (limited to 'io.c')
-rw-r--r--io.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/io.c b/io.c
index 9ca29dac..a3d68ce0 100644
--- a/io.c
+++ b/io.c
@@ -1474,12 +1474,13 @@ flush_io()
/* close_io --- close all open files, called when exiting */
int
-close_io(bool *stdio_problem)
+close_io(bool *stdio_problem, bool *got_EPIPE)
{
struct redirect *rp;
struct redirect *next;
int status = 0;
+ *stdio_problem = *got_EPIPE = false;
errno = 0;
for (rp = red_head; rp != NULL; rp = next) {
next = rp->next;
@@ -1505,6 +1506,9 @@ close_io(bool *stdio_problem)
#endif
if (errno != EPIPE)
warning(_("error writing standard output (%s)"), strerror(errno));
+ else
+ *got_EPIPE = true;
+
status++;
*stdio_problem = true;
}
@@ -1515,6 +1519,9 @@ close_io(bool *stdio_problem)
#endif
if (errno != EPIPE)
warning(_("error writing standard error (%s)"), strerror(errno));
+ else
+ *got_EPIPE = true;
+
status++;
*stdio_problem = true;
}