mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 04:27:35 +00:00
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:
parent
681bb1fb23
commit
4be2cb895c
1 changed files with 1 additions and 1 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue