diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-06-17 21:52:28 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-06-17 21:52:28 +0300 |
commit | edaf82c330629586b1158a3dec407d53084b02e3 (patch) | |
tree | 60774046dec03325ad6e14846c2e25edafe6ba2f /interpret.h | |
parent | 63c5726f8c7bc3c0e6457840049d83d6a2f09995 (diff) | |
download | egawk-edaf82c330629586b1158a3dec407d53084b02e3.tar.gz egawk-edaf82c330629586b1158a3dec407d53084b02e3.tar.bz2 egawk-edaf82c330629586b1158a3dec407d53084b02e3.zip |
Fix a corner case with EPIPE to stdout/stderr.
Diffstat (limited to 'interpret.h')
-rw-r--r-- | interpret.h | 6 |
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; |