-
Notifications
You must be signed in to change notification settings - Fork 99
Get Windows return code in wait() #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Currently, wait() returns 0 on windows regardless of the actual return code of processes.
DWORD dretcode_; | ||
|
||
if (FALSE == GetExitCodeProcess(process_handle_, &dretcode_)) | ||
throw OSError("Failed during call to GetExitCodeProcess", 0); | ||
|
||
return (int)dretcode_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have two questions:
-
Why not check that
WaitForSingleObject
returnsWAIT_OBJECT_0
? -
Why not close
process_handle_
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lunacd Can you please respond to the review questions whenever you get time ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure on that part of the windows API. My fix was targeted at getting the return code, but both items sound like issues to follow up on too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, wait() returns 0 on windows regardless of the actual return code of processes. Github-Pull: arun11299/cpp-subprocess#109 Rebased-From: 04b015a8e52ead4d8bb5f0eb486419c77e418a17
Currently, wait() returns 0 on windows regardless of the actual return code of processes. Github-Pull: arun11299/cpp-subprocess#109 Rebased-From: 04b015a8e52ead4d8bb5f0eb486419c77e418a17
cd95c9d subprocess: check and handle fcntl(F_GETFD) failure (Tomás Andróil) b7288de subprocess: Proper implementation of wait() on Windows (Haowen Liu) 7423214 subprocess: Do not escape double quotes for command line arguments on Windows (Hennadii Stepanov) bb9ffea subprocess: Explicitly define move constructor of Streams class (Shunsuke Shimizu) 174bd43 subprocess: Avoid leaking POSIX name aliases beyond `subprocess.h` (Hennadii Stepanov) 7997b76 subprocess: Fix cross-compiling with mingw toolchain (Hennadii Stepanov) 6476304 subprocess: Get Windows return code in wait() (Haowen Liu) d3f511b subprocess: Fix string_arg when used with rref (Haowen Liu) 2fd3f2f subprocess: Fix memory leaks (Haoran Peng) Pull request description: Most of these changes were developed during work on #29868 and #32342 and have since been upstreamed. As they are now merged, this PR backports them to our `src/util/subprocess.h` header. Required for #29868. A list of the backported PRs: - arun11299/cpp-subprocess#106 - arun11299/cpp-subprocess#110 - arun11299/cpp-subprocess#109 - arun11299/cpp-subprocess#99 - arun11299/cpp-subprocess#112 - arun11299/cpp-subprocess#107 - arun11299/cpp-subprocess#113 - arun11299/cpp-subprocess#116 - arun11299/cpp-subprocess#117 The following PRs were skipped for backporting: - arun11299/cpp-subprocess#108 because we are not planning to support this feature. - arun11299/cpp-subprocess#101 because that change has been already landed in #29849. ACKs for top commit: theStack: Light ACK cd95c9d laanwj: Code review re-ACK cd95c9d Tree-SHA512: f9b60b932957d2e1cad1d87f2ad8bb68c97136e9735eb78547018a42cc50c4652750367f29462eadb0512c27db1dd8a7d4b17a2f0aeab62b3dbf86db5f51a61c
Currently, wait() returns 0 on windows regardless of the actual return code of processes. Github-Pull: arun11299/cpp-subprocess#109 Rebased-From: 04b015a8e52ead4d8bb5f0eb486419c77e418a17
Currently, wait() returns 0 on windows regardless of the actual return code of processes. Github-Pull: arun11299/cpp-subprocess#109 Rebased-From: 04b015a8e52ead4d8bb5f0eb486419c77e418a17
Currently, wait() returns 0 on windows regardless of the actual return code of processes. Github-Pull: arun11299/cpp-subprocess#109 Rebased-From: 04b015a8e52ead4d8bb5f0eb486419c77e418a17
Currently, wait() returns 0 on windows regardless of the actual return code of processes. Github-Pull: arun11299/cpp-subprocess#109 Rebased-From: 04b015a8e52ead4d8bb5f0eb486419c77e418a17 Github-Pull: bitcoin#32358 Rebased-From: 6476304
Currently, wait() returns 0 on windows regardless of the actual return code of processes.