Skip to content

Commit

Permalink
Shell: Do not assume that wstatus is valid after wait() returns 0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alimpfard authored and awesomekling committed Jul 30, 2020
1 parent 681bb1f commit 4be2cb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Shell/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 4be2cb8

Please sign in to comment.