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: Sat, 25 Mar 2017 20:16:08 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111113 Thunderbird/8.0

On 25/03/2017 20:06, Andrew J. Schorr wrote:
On Sat, Mar 25, 2017 at 07:56:38PM +0100, FERRIEUX Alexandre - IMT/OLN wrote:
 On 25/03/2017 16:13, Andrew J. Schorr wrote:
 >[non-POSIX] It looks like Cygwin is OK, but I don't
 >know about the others. Is 128+EPIPE a cross-platform standard?
 >

 Well, if you're afraid of what can happen when you call exit(141) instead of 
exit(1), just use a bit of ifdeffery..

I defer to Arnold. Using lots of platform-specific ifdefs is really ugly and
error-prone and hard to maintain. This issue arises in several places in the
code, so we would need a special epipe_exit function. Is it worth it?

OK, so, on behalf of the worst behavior (of a few non-posix oddball OSes), you'd rather sacrifice the unix instance of ... awk ? All of this for a "hard to maintain" 3-liner

#ifdef POSIX
# define SIGPIPE_EXIT_CODE  (128|EPIPE)
#else
# define SIGPIPE_EXIT_CODE   1 /* my OS is too dumb to tolerate more than one 
bit here *:
#endif

// then call exit(SIGPIPE_EXIT_CODE) everywhere (and not a specific function 
...)

Seriously...



reply via email to

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