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


Groups > gnu.bash.bug > #14903 > unrolled thread

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

Started byChet Ramey <chet.ramey@case.edu>
First post2018-12-10 09:31 -0500
Last post2018-12-10 09:31 -0500
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

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

FromChet Ramey <chet.ramey@case.edu>
Date2018-12-10 09:31 -0500
SubjectRe: write() not retried after EINTR in printf and echo
Message-ID<mailman.5524.1544452314.1284.bug-bash@gnu.org>
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/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web