Jim Meyering wrote:
> fail=0;
> -test-pread || fail=1
> +echo abc | test-pread || fail=1
When I execute it step by step, on Linux (openSUSE 11.0, bash 3.2.1), I get an
error message on stderr:
$ bash
$ : ${srcdir=.}
$ . $srcdir/init.sh --set-path=.
$ fail=0;
$ echo abc | test-pread || fail=1
bash: echo: write error: Broken pipe
$ echo $fail
0
$ exit
exit
The signal mask of the process before and after running init.sh:
UID PID PENDING BLOCKED IGNORED CAUGHT
STAT TTY TIME COMMAND
1000 18935 0000000000000000 0000000000000000 0000000000384004 000000004b813efb
S+ pts/10 0:00 bash
1000 18935 0000000000000000 0000000000000000 0000000000380004 000000004b817efb
S+ pts/10 0:00 bash
So, you can see that signal 15 is now being caught rather than ignored.
But that looks probably unrelated.
When I replace the 'echo abc' with a call to coreutils' echo program, the
error message goes away.
When I write
echo abc 2>/dev/null | test-pread
the error message also goes away.
Bruno