mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Improve wait statuses
This change has the insight that dwExitCode isn't an exit code but rather should be used to pass the wait status. This lets us report killing as a termination status, similar to UNIX. This change also fixes the fact that exit(259) on Windows will break the parent due way WIN32 is designed. We now work around that. It turns out that NetBSD and OpenBSD, will let you have exit codes beyond 255. This change will let you use them when it's possible.
This commit is contained in:
parent
d9d5f45e2d
commit
c8aa33e0e2
22 changed files with 259 additions and 75 deletions
|
@ -28,10 +28,10 @@ __msabi extern typeof(TerminateProcess) *const __imp_TerminateProcess;
|
|||
* Terminates the specified process and all of its threads.
|
||||
* @note this wrapper takes care of ABI, STRACE(), and __winerr()
|
||||
*/
|
||||
textwindows bool32 TerminateProcess(int64_t hProcess, uint32_t uExitCode) {
|
||||
textwindows bool32 TerminateProcess(int64_t hProcess, uint32_t uWaitStatus) {
|
||||
bool32 ok;
|
||||
ok = __imp_TerminateProcess(hProcess, uExitCode);
|
||||
ok = __imp_TerminateProcess(hProcess, uWaitStatus);
|
||||
if (!ok) __winerr();
|
||||
NTTRACE("TerminateProcess(%ld, %u) → %hhhd% m", hProcess, uExitCode, ok);
|
||||
NTTRACE("TerminateProcess(%ld, %u) → %hhhd% m", hProcess, uWaitStatus, ok);
|
||||
return ok;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue