jobs: Only block in waitcmd on first run
commit6359d7aa739b9f02f622805f4dbddeaf0ae61981
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 2 Dec 2020 05:31:45 +0000 (2 16:31 +1100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 23 Dec 2020 07:55:20 +0000 (23 18:55 +1100)
tree681c7b7a3ce9cda2d54292d5304d664bd574b4be
parent1f6fc2dc2f6e64248c43f94d4c52bb762c6fefce
jobs: Only block in waitcmd on first run

This patch ensures that waitcmd never blocks unless there are
outstanding jobs.  This could otherwise trigger a hang if children
were created prior to the shell coming into existence, or if
there are backgrounded children of other kinds (e.g., a here-
document).

Fixes: 6c691b3e5099 ("jobs: Only clear gotsigchld when waiting...")
Reported-by: Michael Biebl <biebl@debian.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
src/jobs.c