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: Andrew J. Schorr
Subject: Re: Undetected fatal errors from redirected print
Date: Thu, 2 Dec 2021 08:32:41 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Dec 02, 2021 at 12:44:14AM -0700, arnold@skeeve.com wrote:
> "Andrew J. Schorr" <aschorr@telemetry-investments.com> wrote:
> 
> > By the way, the logic in io.c:non_fatal_flush_std_file is somewhat similar 
> > to
> > builtin.c:wrerror. Maybe those should be somehow combined.
> 
> They are similar, but it looked a little too messy to combine them.

Fair enough.

> > Actually, the call to w32_maybe_set_errno() appears in 6
> > places (main.c:usage, main.c:copyleft, builtin.c:wrerror,
> > io.c:non_fatal_flush_std_file, io.c:close_io). Maybe there should be
> > some attempt to unify this logic.
> 
> I have prettified this somewhat.  Git is updated.

I see you didn't like the "return <function returning void>" construct. It's a
bit weird, but I wrote a test program to prove it works as expected. Having
changed efflush to get rid of that construct, wouldn't you need to patch
efwrite as well (which is more painful, and the reason I did it that
way in the first place)? It just seemed clunky to say { wrerror(); return; }

Regards,
Andy



reply via email to

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