bug-gawk
[Top][All Lists]
Advanced

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

Re: Undetected fatal errors from redirected print


From: arnold
Subject: Re: Undetected fatal errors from redirected print
Date: Tue, 30 Nov 2021 08:39:50 -0700
User-agent: Heirloom mailx 12.5 7/5/10

Hi.

"Andrew J. Schorr" <aschorr@telemetry-investments.com> wrote:

> > One small request:
> > +           /* flush before closing to take advantage of the error
> > +            * handling */
> > Please do that as one line, or else as two lines using // comments.
>
> I changed it to:
>
>         if ((rp->flag & RED_WRITE) && rp->output.fp)
>                 /* flush before closing to leverage special error handling */
>                 efflush(rp->output.fp, "close_redir", rp);

That's fine.

> OK? Or do you prefer // for one-liners like that?

Either one is fine. No preference one over the other.

> > Please add a ChangeLog entry and push to gawk-5.1-stable.
>
> We still need to consider the special fflush handling of stdout and stderr
> in io.c:close_io.

Leave it as is, please.

> Miguel proposed adding the equivalent of
>       efflush(stdout, "close_io", NULL);
> at the top of that section. So that raises a few issues.

Please do not.

> So I'm not sure what to make of this. It seems there were some specific
> policies established for how to handle stdout/stderr flush problems on exit. 

Yes. We report problems flushing them and trust the result from fflush()
instead of trying to use fclose.

In short, let's leave that code as is.

Thanks,

Arnold



reply via email to

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