mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Patch #101032, from David Bolen:
Ensure the "proxied" command's return code bubbles back up.
This commit is contained in:
parent
b37a373496
commit
fb439abbc9
1 changed files with 5 additions and 2 deletions
|
@ -27,6 +27,7 @@ int main(int argc, char *argv[])
|
||||||
BOOL bRet;
|
BOOL bRet;
|
||||||
STARTUPINFO si;
|
STARTUPINFO si;
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
|
DWORD exit_code=0;
|
||||||
|
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
MessageBox(NULL, usage, argv[0], MB_OK);
|
MessageBox(NULL, usage, argv[0], MB_OK);
|
||||||
|
@ -50,10 +51,12 @@ int main(int argc, char *argv[])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (bRet) {
|
if (bRet) {
|
||||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
if (WaitForSingleObject(pi.hProcess, INFINITE) != WAIT_FAILED) {
|
||||||
|
GetExitCodeProcess(pi.hProcess, &exit_code);
|
||||||
|
}
|
||||||
CloseHandle(pi.hProcess);
|
CloseHandle(pi.hProcess);
|
||||||
CloseHandle(pi.hThread);
|
CloseHandle(pi.hThread);
|
||||||
return 0;
|
return exit_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue