On 01/20/2012 11:06 PM, Paul Eggert wrote:
> I took a look and came up with four related patches to fix these.
> Here's the first one. It fixes the originally-reported bug.
I found a problem in that patch's test case: it assumes
that SIGPIPE has the default action when the test is
run, which isn't a portable assumption. I installed the
following further patch to fix this bug in the test case.
tests: work even if SIGPIPE is ignored
* tests/epipe: Do not infinite-loop if SIGPIPE is already ignored.
It could be that the invoker of 'make check' ignores SIGPIPE,
for example.
diff --git a/tests/epipe b/tests/epipe
index 336d994..f9cb3f6 100755
--- a/tests/epipe
+++ b/tests/epipe
@@ -6,7 +6,7 @@
if
(
- while :; do echo x; done |
+ (trap - PIPE; while echo x; do :; done) 3>&- |
(trap '' PIPE; exec grep x 2>&3) |
:
) 3>&1 | (