mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Revert r235177 as the Handle is used to fail GetExitCodeProcess on purpose.
Avoid double closing of the handle by testing GetLastErr for ERROR_INVALID_HANDLE and not calling CloseHandle(PI.ProcessHandle) then. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235184 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -423,6 +423,7 @@ ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait,
|
||||
return WaitResult;
|
||||
}
|
||||
WaitForSingleObject(PI.ProcessHandle, INFINITE);
|
||||
CloseHandle(PI.ProcessHandle);
|
||||
} else {
|
||||
// Non-blocking wait.
|
||||
return ProcessInfo();
|
||||
@@ -433,6 +434,7 @@ ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait,
|
||||
DWORD status;
|
||||
BOOL rc = GetExitCodeProcess(PI.ProcessHandle, &status);
|
||||
DWORD err = GetLastError();
|
||||
if (err != ERROR_INVALID_HANDLE)
|
||||
CloseHandle(PI.ProcessHandle);
|
||||
|
||||
if (!rc) {
|
||||
|
Reference in New Issue
Block a user