Commit | Line | Data |
---|---|---|
8a417981 VM |
1 | diff --git a/io.c b/io.c |
2 | index a6e786f..2bb8f28 100644 | |
3 | --- a/io.c | |
4 | +++ b/io.c | |
5 | @@ -2078,6 +2078,7 @@ use_pipes: | |
6 | || close(ctop[0]) == -1 || close(ctop[1]) == -1) | |
7 | fatal(_("close of pipe failed (%s)"), strerror(errno)); | |
8 | /* stderr does NOT get dup'ed onto child's stdout */ | |
9 | + signal(SIGPIPE, SIG_DFL); | |
10 | execl("/bin/sh", "sh", "-c", str, NULL); | |
11 | _exit(errno == ENOENT ? 127 : 126); | |
12 | } | |
13 | @@ -2271,6 +2272,7 @@ gawk_popen(const char *cmd, struct redirect *rp) | |
14 | fatal(_("moving pipe to stdout in child failed (dup: %s)"), strerror(errno)); | |
15 | if (close(p[0]) == -1 || close(p[1]) == -1) | |
16 | fatal(_("close of pipe failed (%s)"), strerror(errno)); | |
17 | + signal(SIGPIPE, SIG_DFL); | |
18 | execl("/bin/sh", "sh", "-c", cmd, NULL); | |
19 | _exit(errno == ENOENT ? 127 : 126); | |
20 | } |