summaryrefslogtreecommitdiff
path: root/PC/w9xpopen.c
diff options
context:
space:
mode:
authorMark Hammond <mhammond@skippinet.com.au>2000-08-14 05:04:28 +0000
committerMark Hammond <mhammond@skippinet.com.au>2000-08-14 05:04:28 +0000
commit019fd0937a780b7e274e77bad9d8358a36122de5 (patch)
tree47ba86d857e843e621a7ea68d6ef10a4f6089f0d /PC/w9xpopen.c
parent9bbb9a0cb3fc561d9deda90dfe123bd04e7d5f24 (diff)
downloadcpython-019fd0937a780b7e274e77bad9d8358a36122de5.tar.gz
Patch #101032, from David Bolen:
Ensure the "proxied" command's return code bubbles back up.
Diffstat (limited to 'PC/w9xpopen.c')
-rw-r--r--PC/w9xpopen.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/PC/w9xpopen.c b/PC/w9xpopen.c
index 160238c317..d96d0f5e58 100644
--- a/PC/w9xpopen.c
+++ b/PC/w9xpopen.c
@@ -27,6 +27,7 @@ int main(int argc, char *argv[])
BOOL bRet;
STARTUPINFO si;
PROCESS_INFORMATION pi;
+ DWORD exit_code=0;
if (argc != 2) {
MessageBox(NULL, usage, argv[0], MB_OK);
@@ -50,10 +51,12 @@ int main(int argc, char *argv[])
);
if (bRet) {
- WaitForSingleObject(pi.hProcess, INFINITE);
+ if (WaitForSingleObject(pi.hProcess, INFINITE) != WAIT_FAILED) {
+ GetExitCodeProcess(pi.hProcess, &exit_code);
+ }
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
- return 0;
+ return exit_code;
}
return 1;