bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH]


From: FERRIEUX Alexandre - IMT/OLN
Subject: Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH]
Date: Sun, 26 Mar 2017 13:24:49 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111113 Thunderbird/8.0

On 26/03/2017 04:38, Eli Zaretskii wrote:
 Date: Sat, 25 Mar 2017 23:48:05 +0100
 From: FERRIEUX Alexandre - IMT/OLN<address@hidden>
 Cc: address@hidden

 Of course the 141 vs 1 is no big deal. But if it comes for free, what about it 
?

 By "for free" I mean an #ifdef appropriate to cover all of true unix. 
Something like

        #ifdef unix
        # define SIGPIPE_EXIT_CODE (128|SIGPIPE)
        #else
        # define SIGPIPE_EXIT_CODE 1
        #endif

This isn't guaranteed to produce 141 on every system, so you don't get
what you want except a small number of platforms.

Sure, I'll get what I need on a "small number" of platforms: only unix :)))

AFAIK, Gawk attempts to provide a more or less portable environment,
and the above is against that goal.

On platforms where the exit status is only a bit, it returns 0 if OK, 1 if not.
On platforms where the exit status is richer, it uses the richer bandwidth.
In all cases the contract "0 if OK, !=0 if not" is enforced.
Is that against portability ?



reply via email to

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