[Top][All Lists]

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

Re: write() not retried after EINTR in printf and echo

From: Chet Ramey
Subject: Re: write() not retried after EINTR in printf and echo
Date: Mon, 10 Dec 2018 09:31:29 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.3.3

On 12/9/18 12:45 PM, Pusillanimous Pussyfooter wrote:
>> There are a couple of signals for which this is the appropriate behavior.
>> The right fix is to install handlers with the SA_RESTART flag set. The
>> next version of bash will install its SIGWINCH handler with SA_RESTART.
> Here is a trivial patch doing just that, though IMHO it would be much better
> and more consistent to check for EINTR and restart the write() system call,
> as it's already done for open() in redir.c:redir_open(). The EINTR "error"
> should never be user visible, no matter what signal had caused it.

That's just not true. You want users to be able to interrupt printf and
echo with SIGINT just the same as they can interrupt any other command.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://tiswww.cwru.edu/~chet/

reply via email to

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