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: Eli Zaretskii
Subject: Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH]
Date: Wed, 29 Mar 2017 18:59:02 +0300

> Date: Wed, 29 Mar 2017 11:29:41 -0400
> From: "Andrew J. Schorr" <address@hidden>
> Cc: address@hidden, address@hidden
> 
> On Wed, Mar 29, 2017 at 05:43:09PM +0300, Eli Zaretskii wrote:
> > 4.1.4 produces similar error messages, except that it doesn't exit the
> > loop, so it produces many more of them.
> > 
> > As to whether this result is horrible: I guess it depends on whether
> > we want the behavior to be more consistent across platforms.  I'd like
> > at least to "fix" errno in this case to be EPIPE, then we can talk
> > about what exit status to produce.  Does that make sense?
> 
> That makes sense to me. I guess we need some more code snippets like this from
> io.c:efwrite:
> 
> #ifdef __MINGW32__
>         if (errno == 0 || errno == EINVAL)
>                 w32_maybe_set_errno();
> #endif
> 
> Perhaps that should be packaged into a macro or inline function. I guess it
> will be needed everywhere the code refers to EPIPE.

Something like that, yes.  My research indicates that the information
telling the pipe was broken is present on a lower level, it's just
that MS libc doesn't propagate it to errno.

> The good news is that master behaves better than 4.1.4, so it seems like we're
> making forward progress, not regressing.

Right.



reply via email to

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