diff options
author | Marcus Brummer <mbrlabs7@gmail.com> | 2020-11-16 18:26:57 +0100 |
---|---|---|
committer | Marcus Brummer <mbrlabs7@gmail.com> | 2020-11-16 18:30:33 +0100 |
commit | f0f4220b05763067e9af9716a9f0a485da971c78 (patch) | |
tree | d3a4f297f14b43cb62ed1b8f4f5a1752a9274613 /platform | |
parent | e5dfb9b25e128d88a4628f82d22fddf3046de75a (diff) |
Fixed exit code retrieval of spawned processes on Windows
Use GetExitCodeProcess() on Windows to retrieve the exit code of a process in
OS:excute()
Diffstat (limited to 'platform')
-rw-r--r-- | platform/windows/os_windows.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index b108d74b2e..646bc3aa4c 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -466,8 +466,10 @@ Error OS_Windows::execute(const String &p_path, const List<String> &p_arguments, ERR_FAIL_COND_V(ret == 0, ERR_CANT_FORK); if (p_blocking) { - DWORD ret2 = WaitForSingleObject(pi.pi.hProcess, INFINITE); + WaitForSingleObject(pi.pi.hProcess, INFINITE); if (r_exitcode) { + DWORD ret2; + GetExitCodeProcess(pi.pi.hProcess, &ret2); *r_exitcode = ret2; } |