X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghc-inplace.c;h=83f683465d95e07f7a0accd26a90c5d4557c34fd;hb=022fc24719ba4b98b8d9f19bfe7f75dd0f19d585;hp=78cffba229df1b9c9e0f8b7d59348cd623daf269;hpb=af2db474c2bb80e29924430e3c730bc217e55189;p=ghc-hetmet.git diff --git a/compiler/ghc-inplace.c b/compiler/ghc-inplace.c index 78cffba..83f6834 100644 --- a/compiler/ghc-inplace.c +++ b/compiler/ghc-inplace.c @@ -51,6 +51,7 @@ int run(char *this, char *program, int argc, char** argv) { int run(char *this, char *program, int argc, char** argv) { TCHAR programShort[MAX_PATH+1]; DWORD dwSize; + DWORD dwExitCode; int i; char* new_cmdline; char *ptr; @@ -131,7 +132,12 @@ int run(char *this, char *program, int argc, char** argv) { switch (WaitForSingleObject(pi.hProcess, INFINITE) ) { case WAIT_OBJECT_0: - return 0; + if (GetExitCodeProcess(pi.hProcess, &dwExitCode)) { + return dwExitCode; + } + else { + return 1; + } case WAIT_ABANDONED: case WAIT_FAILED: /* in the event we get any hard errors, bring the child