mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 06:37:52 +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:
committed by
Andreas Kling
parent
681bb1fb23
commit
4be2cb895c
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user