Daniel Richard G. wrote:
> The second test is test-sigpipe.sh:
> 
>     $ /path/to/testdir/gltests/test-sigpipe.sh
>     CEE5213S The signal SIGPIPE was received.
>     $ echo $?
>     1
> 
> The default SIGPIPE signal handler appears to write to stderr, and this
> is separate from the "Broken pipe" message printed to the terminal:
> 
>     $ ./test-sigpipe A | head -1
>     y
>     CEE5213S The signal SIGPIPE was received.
>     Broken pipe
> 
> This test could probably use a tweak as well.

I would argue that this behaviour is not POSIX compliant. Quoting the POSIX
standard [1]:

  Signal: SIGPIPE
  Default action: T

  The default actions are as follows:
  T
      Abnormal termination of the process.
  A
      Abnormal termination of the process [XSI] [Option Start]  with additional 
actions. [Option End]

Writing to stderr is an additional action this is OK for 'A' but not for 'T'.

Bruno

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html


Reply via email to