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: arnold
Subject: Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH]
Date: Sun, 19 Mar 2017 01:16:01 -0600
User-agent: Heirloom mailx 12.4 7/29/08

"Andrew J. Schorr" <address@hidden> wrote:

> Hi,
>
> On Fri, Mar 17, 2017 at 08:44:35AM +0200, Arnold Robbins wrote:
> > Thanks for the reports and discussions. I tackled the problem with the
> > patch below. I plan to commit it soon.  Andy - please review.
>
> I generally dislike that you are calling is_non_fatal_redirect() or
> is_non_fatal_std() before calling fflush. You are incurring the overhead of 
> the
> PROCINFO lookup before the fflush call fails. Why take that performance hit
> until we actually encounter an I/O error?
>
> Does the change in SIGPIPE handling have anything to do with this issue,
> or is that an unrelated code cleanup?
>
> Regards,
> Andy

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...

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. :-)

Thanks,

Arnold



reply via email to

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