[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH]
From: |
Andrew J. Schorr |
Subject: |
Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH] |
Date: |
Fri, 24 Mar 2017 20:16:09 -0400 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Mar 23, 2017 at 01:36:40PM -0600, address@hidden wrote:
> --- a/builtin.c
> +++ b/builtin.c
> @@ -131,14 +131,18 @@ wrerror:
> #endif
> /* die silently on EPIPE to stdout */
> if (fp == stdout && errno == EPIPE)
> - gawk_exit(EXIT_FATAL);
> + gawk_exit(EXIT_SUCCESS); // a la SIGPIPE
By the way, I don't understand this. Why is it exiting successfully
when it catches a SIGPIPE? As far as I can tell, that's not normal.
For example:
bash-4.2$ set -o pipefail
bash-4.2$ head -1 /etc/services && echo SUCCESS
rtmp 1/ddp
SUCCESS
bash-4.2$ cat /etc/services | head -1 && echo SUCCESS
rtmp 1/ddp
bash-4.2$ grep . /etc/services | head -1 && echo SUCCESS
rtmp 1/ddp
bash-4.2$ /bin/gawk 1 /etc/services | head -1 && echo SUCCESS
rtmp 1/ddp
bash-4.2$
But after applying your patch:
bash-4.2$ ./gawk 1 /etc/services | head -1 && echo SUCCESS
rtmp 1/ddp
SUCCESS
bash-4.2$
Why should gawk exit successfully in that situation?
Regards,
Andy
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], (continued)
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Arnold Robbins, 2017/03/17
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/17
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], arnold, 2017/03/19
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/19
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], arnold, 2017/03/20
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/21
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], arnold, 2017/03/22
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], arnold, 2017/03/23
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/23
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], arnold, 2017/03/24
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH],
Andrew J. Schorr <=
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], FERRIEUX Alexandre - IMT/OLN, 2017/03/25
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/25
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], FERRIEUX Alexandre - IMT/OLN, 2017/03/25
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/25
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], FERRIEUX Alexandre - IMT/OLN, 2017/03/25
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/25
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], FERRIEUX Alexandre - IMT/OLN, 2017/03/25
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/25
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], FERRIEUX Alexandre - IMT/OLN, 2017/03/25
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/25