code shrink in check_errors_in_children()
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
7794c21daf
commit
577235dee8
@ -34,6 +34,7 @@ void check_errors_in_children(int signo)
|
|||||||
if (!signo) {
|
if (!signo) {
|
||||||
/* block waiting for any child */
|
/* block waiting for any child */
|
||||||
if (wait(&status) < 0)
|
if (wait(&status) < 0)
|
||||||
|
//FIXME: check EINTR?
|
||||||
return; /* probably there are no children */
|
return; /* probably there are no children */
|
||||||
goto check_status;
|
goto check_status;
|
||||||
}
|
}
|
||||||
@ -41,14 +42,18 @@ void check_errors_in_children(int signo)
|
|||||||
/* Wait for any child without blocking */
|
/* Wait for any child without blocking */
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (wait_any_nohang(&status) < 0)
|
if (wait_any_nohang(&status) < 0)
|
||||||
|
//FIXME: check EINTR?
|
||||||
/* wait failed?! I'm confused... */
|
/* wait failed?! I'm confused... */
|
||||||
return;
|
return;
|
||||||
check_status:
|
check_status:
|
||||||
if (WIFEXITED(status) && WEXITSTATUS(status) == 0)
|
/*if (WIFEXITED(status) && WEXITSTATUS(status) == 0)*/
|
||||||
|
/* On Linux, the above can be checked simply as: */
|
||||||
|
if (status == 0)
|
||||||
/* this child exited with 0 */
|
/* this child exited with 0 */
|
||||||
continue;
|
continue;
|
||||||
/* Cannot happen?
|
/* Cannot happen:
|
||||||
if (!WIFSIGNALED(status) && !WIFEXITED(status)) ???; */
|
if (!WIFSIGNALED(status) && !WIFEXITED(status)) ???;
|
||||||
|
*/
|
||||||
bb_got_signal = 1;
|
bb_got_signal = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user