redir: Retry open64 on EINTR
commit282bdbd228a5e6f86ca7eec488d852d3dd3f2957
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 28 May 2020 11:31:45 +0000 (28 21:31 +1000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 1 Jun 2020 13:28:36 +0000 (1 23:28 +1000)
treecdc08ea4a2ac05d5806526ad07c53e060c7476e0
parentd80189f2b99a4172a60589b6c23eedc2b4077a20
redir: Retry open64 on EINTR

It is possible for open64 to block on named pipes, and therefore
it can be interrupted by signals and return EINTR.  We should only
let it fail with EINTR if real signals are pending (i.e., it should
not fail on SIGCHLD if SIGCHLD has not been trapped).

This patch adds a new helper sh_open to retry the open64 call if
necessary.  It also calls sh_error when appropriate.

Fixes: 3800d4934391 ("[JOBS] Fix dowait signal race")
Reported-by: Samuel Thibault <sthibault@debian.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
src/input.c
src/jobs.c
src/redir.c
src/redir.h