bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: z/OS sigpipe test failures due to quirky error handling


From: Bruno Haible
Subject: Re: z/OS sigpipe test failures due to quirky error handling
Date: Wed, 01 Mar 2017 00:54:19 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-64-generic; KDE/5.18.0; x86_64; ; )

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

[Prev in Thread] Current Thread [Next in Thread]