1
0
mirror of https://github.com/janet-lang/janet synced 2025-08-30 09:28:03 +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:
Calvin Rose
2024-02-15 04:01:09 -08:00
committed by GitHub

View File

@@ -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;
}