Init: exit if the primary child process exits
This commit is contained in:
parent
51665a04b7
commit
20db8eaba6
@ -67,11 +67,14 @@ int main()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pid_t result;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
while (wait(NULL) == 0) // No child has exited yet
|
while ((result = wait(NULL)) == 0) // No child has exited yet
|
||||||
{
|
{
|
||||||
msleep(100);
|
msleep(100);
|
||||||
}
|
}
|
||||||
|
if (result == child) { return 0; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user