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


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

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

Started byBize Ma <binaryzebra@gmail.com>
First post2018-12-19 22:15 -0500
Last post2018-12-19 22:15 -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 Bize Ma <binaryzebra@gmail.com> - 2018-12-19 22:15 -0500

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

FromBize Ma <binaryzebra@gmail.com>
Date2018-12-19 22:15 -0500
SubjectRe: write() not retried after EINTR in printf and echo
Message-ID<mailman.5984.1545275742.1284.bug-bash@gnu.org>
Chet Ramey (<chet.ramey@case.edu>) wrote:

> And yet, when you look at the source, the signal handlers are installed
> with SA_RESTART. For example,
>


> #  if defined (SIGWINCH)
>   act.sa_flags = (sig == SIGWINCH) ? SA_RESTART : 0;
> #  else
>   act.sa_flags = 0;
> #  endif /* SIGWINCH */
>
> in lib/readline/signals.c:rl_set_sighandler().
>
>
True for SIGWINCH, but "write error: Interrupted system call"
is still exposed to users (which it shouldn't) for other signals:

{   pid=$BASHPID; trap : USR1;
    (sleep 1; kill -USR1 "$pid") &
    printf %0100000d 1;
} | sleep 20

[toc] | [standalone]


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


csiph-web