From: Mark Hammond Date: Mon, 14 Aug 2000 05:04:28 +0000 (+0000) Subject: Patch #101032, from David Bolen: X-Git-Tag: v2.0b1~470 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb439abbc9bbec93ff11d1c9ddf268bb8e415900;p=thirdparty%2FPython%2Fcpython.git Patch #101032, from David Bolen: Ensure the "proxied" command's return code bubbles back up. --- diff --git a/PC/w9xpopen.c b/PC/w9xpopen.c index 160238c31777..d96d0f5e5876 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;