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: Mon, 27 Mar 2017 23:40:19 -0600
User-agent: Heirloom mailx 12.4 7/29/08

Eli Zaretskii <address@hidden> wrote:

> > Gawk will exit FATAL. It should all work ok.
>
> I'm not sure it will, but I don't think I see the whole picture yet.
>
> Shouldn't we emulate an abnormal exit, as in "crash"?  EXIT_FAIL is
> not it, it just means "some error".

"Crash" to me means core dump. SIGPIPE doesn't cause a core dump, it
just causes exit with the death-by-signal bit set and the signal number
in the status. The shells turn that into 128 + signal number.

For non-POSIX we could use a different signal, but we'd have to choose
one that's pretty universal. SIGHUP might be the best bet.
Or just leave well enough alone. :-)

> > If you want a tarball let me know
>
> Yes, please.  And also a script that could be used to test this
> situation.

URL sent.

Script is what started the discussion

        yes | gawk '{ print; fflush(stdout) }' | head

(Side note: 'stdout' isn't reserved in gawk; it's just an empty variable
that has the effect of `fflush("")' meaning flush everything. "/dev/stdout"
is what should have been used.)

Thanks,

Arnold



reply via email to

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