Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14903

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

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: write() not retried after EINTR in printf and echo
Date 2018-12-10 09:31 -0500
Message-ID <mailman.5524.1544452314.1284.bug-bash@gnu.org> (permalink)
References <60ea8ca0754bfa9ebb3445b76c3ffbc6.063f4e69@diviner.protectiveness>

Show all headers | View raw


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    chet@case.edu    http://tiswww.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: write() not retried after EINTR in printf and echo Chet Ramey <chet.ramey@case.edu> - 2018-12-10 09:31 -0500

csiph-web