mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04: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
9888d0f511
commit
9e8992bf8b
1 changed files with 6 additions and 1 deletions
|
@ -1043,7 +1043,12 @@ inline int Popen::wait() noexcept(false)
|
||||||
#ifdef __USING_WINDOWS__
|
#ifdef __USING_WINDOWS__
|
||||||
int ret = WaitForSingleObject(process_handle_, INFINITE);
|
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
|
#else
|
||||||
int ret, status;
|
int ret, status;
|
||||||
std::tie(ret, status) = util::wait_for_child_exit(child_pid_);
|
std::tie(ret, status) = util::wait_for_child_exit(child_pid_);
|
||||||
|
|
Loading…
Add table
Reference in a new issue