]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #101032, from David Bolen:
authorMark Hammond <mhammond@skippinet.com.au>
Mon, 14 Aug 2000 05:04:28 +0000 (05:04 +0000)
committerMark Hammond <mhammond@skippinet.com.au>
Mon, 14 Aug 2000 05:04:28 +0000 (05:04 +0000)
Ensure the "proxied" command's return code bubbles back up.

PC/w9xpopen.c

index 160238c3177744b81ce7c21ee5e3796851873f28..d96d0f5e5876dd0c0070803a739534df06d4cbf3 100644 (file)
@@ -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;