mirror of
https://github.com/janet-lang/janet
synced 2024-11-24 09:17:17 +00:00
Merge pull request #1403 from llmII/fix-os-proc-wait
Fix: make `proc_get_status` compliant to OS documentation.
This commit is contained in:
commit
49eb5f8563
@ -505,8 +505,11 @@ static int proc_get_status(JanetProc *proc) {
|
||||
status = WEXITSTATUS(status);
|
||||
} else if (WIFSTOPPED(status)) {
|
||||
status = WSTOPSIG(status) + 128;
|
||||
} else {
|
||||
} else if (WIFSIGNALED(status)){
|
||||
status = WTERMSIG(status) + 128;
|
||||
} else {
|
||||
/* Could possibly return -1 but for now, just panic */
|
||||
janet_panicf("Undefined status code for process termination, %d.", status);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user