Shell: Do not assume that wstatus is valid after wait() returns 0

According to the linux waitid manpage, the value of wstatus is
unspecified if wait() returns 0, so we should not assume that any
value it holds is correct (including the exit code).
This is only applicable to the Lagom build.
This commit is contained in:
AnotherTest 2020-07-28 06:34:07 +04:30 committed by Andreas Kling
commit 4be2cb895c
Notes: sideshowbarker 2024-07-19 04:27:46 +09:00

View file

@ -99,7 +99,7 @@ int main(int argc, char** argv)
#ifndef __serenity__
if (child_pid == 0) {
// Linux: if child didn't "change state", but existed.
child_pid = job.value->pid();
continue;
}
#endif
if (child_pid == job.value->pid()) {