o Now when SIG_IGN signal action for SIGCHLD reap zombies

automatically it is possible wait4(2) returns -1 and sets
errno = ECHILD if there were forked children.  A user can
set such signal handler e.g. via ``trap "" 20'', see a PR
for the test case.  Deal with this case and mark a job as
JOBDONE.

PR:		bin/90334
Submitted by:	bde
MFC after:	4 weeks
This commit is contained in:
Maxim Konovalov 2005-12-14 17:26:29 +00:00
parent 59a269294f
commit 19d099fc86
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=153417

View File

@ -924,6 +924,8 @@ dowait(int block, struct job *job)
} while ((pid == -1 && errno == EINTR && breakwaitcmd == 0) ||
(pid > 0 && WIFSTOPPED(status) && !iflag));
in_dowait--;
if (pid == -1 && errno == ECHILD && job != NULL)
job->state = JOBDONE;
if (breakwaitcmd != 0) {
breakwaitcmd = 0;
if (pid <= 0)