[Top][All Lists]

[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: Sun, 26 Mar 2017 11:32:57 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Mar 26, 2017 at 05:29:43PM +0200, FERRIEUX Alexandre - IMT/OLN wrote:
> On 26/03/2017 17:21, Eli Zaretskii wrote:
> >> Date: Sun, 26 Mar 2017 16:39:52 +0200
> >> From: FERRIEUX Alexandre - IMT/OLN<address@hidden>
> >> CC:<address@hidden>,<address@hidden>
> >>
> >> >>   Is that against portability ?
> >> >
> >> >  The way you want it? yes, because I cannot write a portable Awk script
> >> >  without system dependencies.
> >>
> >> No, not the Awk script but its caller.
> >
> >An Awk script can invoke another instance of Awk, right?
> Regardless, *any* language is able to use "!=0" as a criterion instead of 
> "==1"

Actually, gawk's exit status is typically 2 when it encounters a fatal error:


   2.6 gawk’s Exit Status

   If the exit statement is used with a value (see Exit Statement), then gawk 
exits with the numeric value given to it.

   Otherwise, if there were no problems during execution, gawk exits with the 
value of the C constant EXIT_SUCCESS. This is usually zero.

   If an error occurs, gawk exits with the value of the C constant 
EXIT_FAILURE. This is usually one.

   If gawk exits because of a fatal error, the exit status is two. On non-POSIX 
systems, this value may be mapped to EXIT_FAILURE.

So we have documented exit status behavior, and now we're going to add
an exception for EPIPE?


reply via email to

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