Thanks for reviewing that.  What a mess!
An odd thing is that the patch *did* fix things for
Fedora 15.  Maybe its shell is busted?  But that's a
different matter.

I think we can address this particular problem without
relying on a new coreutils feature, though the feature
you mention does sound useful for other reasons.

I pushed this:

tests: work portably even if SIGPIPE is ignored
* tests/epipe: Don't rely on "trap - PIPE"; that's not portable.
Problem reported by Eric Blake in
<http://lists.gnu.org/archive/html/bug-grep/2012-02/msg00017.html>.
Also, use "ls -al" rather than "echo", in case "echo" is done by a
buggy shell that ignores write errors.  And close grep's fd 3, as
a sanity check.
diff --git a/tests/epipe b/tests/epipe
index f9cb3f6..1d9ef05 100755
--- a/tests/epipe
+++ b/tests/epipe
@@ -6,8 +6,8 @@

 if
    (
-     (trap - PIPE; while echo x; do :; done) 3>&- |
-     (trap '' PIPE; exec grep x 2>&3) |
+     while ls -al; do :; done 3>&- |
+     (trap '' PIPE; exec grep . 2>&3 3>&-) |
      :
    ) 3>&1 | (
      read line1 && echo >&2 "$line1" &&

Reply via email to