summaryrefslogtreecommitdiff
path: root/compiler/ghc-inplace.c
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2007-08-21 10:10:28 +0000
committerIan Lynagh <igloo@earth.li>2007-08-21 10:10:28 +0000
commit27802c599d26c3358cb9870b6861cd32209bbe58 (patch)
tree607888f7db91d3d597ee08e22ac5594d9a66bb0d /compiler/ghc-inplace.c
parentda6f8e12f3888e5bfe5f9198661fab432fd4467e (diff)
downloadhaskell-27802c599d26c3358cb9870b6861cd32209bbe58.tar.gz
Make ghc-inplace return GHC's exitcode on Windows
Diffstat (limited to 'compiler/ghc-inplace.c')
-rw-r--r--compiler/ghc-inplace.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/ghc-inplace.c b/compiler/ghc-inplace.c
index 78cffba229..83f683465d 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