aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--io.c2
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 61bec4e6..6185b1d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-04-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * io.c (two_way_open): In forked child, reset SIGPIPE to SIG_DFL.
+ Fixes problems with "broken pipe" errors from child processes,
+ restoring 4.1.0 and earlier behavior. Thanks to Daryl F
+ <wyatt@prairieturtle.ca> for the report.
+ (gawk_popen): Ditto.
+
2014-04-25 Arnold D. Robbins <arnold@skeeve.com>
* dfa.h, dfa.c: Merge with GNU grep; lots of forward motion.
diff --git a/io.c b/io.c
index a6e786f7..2bb8f28a 100644
--- a/io.c
+++ b/io.c
@@ -2078,6 +2078,7 @@ use_pipes:
|| close(ctop[0]) == -1 || close(ctop[1]) == -1)
fatal(_("close of pipe failed (%s)"), strerror(errno));
/* stderr does NOT get dup'ed onto child's stdout */
+ signal(SIGPIPE, SIG_DFL);
execl("/bin/sh", "sh", "-c", str, NULL);
_exit(errno == ENOENT ? 127 : 126);
}
@@ -2271,6 +2272,7 @@ gawk_popen(const char *cmd, struct redirect *rp)
fatal(_("moving pipe to stdout in child failed (dup: %s)"), strerror(errno));
if (close(p[0]) == -1 || close(p[1]) == -1)
fatal(_("close of pipe failed (%s)"), strerror(errno));
+ signal(SIGPIPE, SIG_DFL);
execl("/bin/sh", "sh", "-c", cmd, NULL);
_exit(errno == ENOENT ? 127 : 126);
}