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: Andrew J. Schorr
Subject: Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH]
Date: Sun, 19 Mar 2017 16:59:09 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

On Sun, Mar 19, 2017 at 01:16:01AM -0600, address@hidden wrote:
> I'll rework the order of things. I don't know that the difference is really
> measureable, but you're right, why go through the hassle...

Thanks -- it just seems wrong to do the array hash lookup for no reason.

> The SIGPIPE handling change is indeed an unrelated cleanup. My first attempt
> to deal with this involved mucking with SIGPIPE and the cutting/pasting of
> three line ifdef was just too ugly to bear. :-)

Fair enough, but should the trivial ignore_sigpipe() and
set_sigpipe_to_default() functions perhaps be inline functions in awk.h?

/* ignore_sigpipe --- ignore SIGPIPE */

static inline void
ignore_sigpipe()
{
#ifdef SIGPIPE
       signal(SIGPIPE, SIG_IGN);
#endif
}

/* set_sigpipe_to_default --- set SIGPIPE to default */

static inline void
set_sigpipe_to_default()
{
#ifdef SIGPIPE
       signal(SIGPIPE, SIG_DFL);
#endif
}

Regards,
Andy



reply via email to

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