mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-12 19:20:42 +02:00
subprocess: Get Windows return code in wait()
Currently, wait() returns 0 on windows regardless of the actual return code of processes. Github-Pull: arun11299/cpp-subprocess#109 Rebased-From: 04b015a8e52ead4d8bb5f0eb486419c77e418a17
This commit is contained in:
parent
d3f511b458
commit
647630462f
@ -1043,7 +1043,12 @@ inline int Popen::wait() noexcept(false)
|
||||
#ifdef __USING_WINDOWS__
|
||||
int ret = WaitForSingleObject(process_handle_, INFINITE);
|
||||
|
||||
return 0;
|
||||
DWORD dretcode_;
|
||||
|
||||
if (FALSE == GetExitCodeProcess(process_handle_, &dretcode_))
|
||||
throw OSError("Failed during call to GetExitCodeProcess", 0);
|
||||
|
||||
return (int)dretcode_;
|
||||
#else
|
||||
int ret, status;
|
||||
std::tie(ret, status) = util::wait_for_child_exit(child_pid_);
|
||||
|
Loading…
Reference in New Issue
Block a user