summaryrefslogtreecommitdiff
path: root/interpret.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2018-06-17 21:52:28 +0300
committerArnold D. Robbins <arnold@skeeve.com>2018-06-17 21:52:28 +0300
commitedaf82c330629586b1158a3dec407d53084b02e3 (patch)
tree60774046dec03325ad6e14846c2e25edafe6ba2f /interpret.h
parent63c5726f8c7bc3c0e6457840049d83d6a2f09995 (diff)
downloadgawk-edaf82c330629586b1158a3dec407d53084b02e3.tar.gz
Fix a corner case with EPIPE to stdout/stderr.
Diffstat (limited to 'interpret.h')
-rw-r--r--interpret.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/interpret.h b/interpret.h
index 20fcb7ad..8408a532 100644
--- a/interpret.h
+++ b/interpret.h
@@ -110,6 +110,7 @@ top:
case Op_atexit:
{
bool stdio_problem = false;
+ bool got_EPIPE = false;
/* avoid false source indications */
source = NULL;
@@ -125,7 +126,7 @@ top:
* and pipes, in that it doesn't affect their exit status.
* So we no longer do either.
*/
- (void) close_io(& stdio_problem);
+ (void) close_io(& stdio_problem, & got_EPIPE);
/*
* However, we do want to exit non-zero if there was a problem
* with stdout/stderr, so we reinstate a slightly different
@@ -135,6 +136,9 @@ top:
exit_val = 1;
close_extensions();
+
+ if (got_EPIPE)
+ die_via_sigpipe();
}
break;