Wait for orphans in init.
This commit is contained in:
parent
266a02ad71
commit
5ce53a2a30
|
@ -52,6 +52,7 @@ int runsystem()
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
waitpid(childpid, &status, 0);
|
waitpid(childpid, &status, 0);
|
||||||
|
while ( 0 < waitpid(-1, NULL, WNOHANG) );
|
||||||
// TODO: Use the proper macro!
|
// TODO: Use the proper macro!
|
||||||
if ( 128 <= WEXITSTATUS(status) || WIFSIGNALED(status) )
|
if ( 128 <= WEXITSTATUS(status) || WIFSIGNALED(status) )
|
||||||
{
|
{
|
||||||
|
@ -61,9 +62,7 @@ int runsystem()
|
||||||
return WEXITSTATUS(status);
|
return WEXITSTATUS(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = child();
|
exit(child());
|
||||||
while ( 0 < waitpid(-1, NULL, WNOHANG) );
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int /*argc*/, char* /*argv*/[])
|
int main(int /*argc*/, char* /*argv*/[])
|
||||||
|
|
Loading…
Reference in New Issue