diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-21 06:23:51 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-21 06:23:51 +0000 |
commit | 9292a6254e40e2e76a53e3c1ae31cbc01e8e0958 (patch) | |
tree | 862be8aead069403b33194f0b8865d0b191bb0cd /win32 | |
parent | d820362c5001c1f35992da9a3728769f56ef68ff (diff) |
* win32/win32.c (do_spawn, do_aspawn): should return child's exit
status to parent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c index cbcecb6f8e..c85b1b48e8 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -735,6 +735,7 @@ int mode; char *cmd; { struct ChildRecord *child; + DWORD exitcode; switch (mode) { case P_WAIT: @@ -759,7 +760,9 @@ char *cmd; return child->pid; case P_OVERLAY: WaitForSingleObject(child->hProcess, INFINITE); - exit(0); + GetExitCodeProcess(child->hProcess, &exitcode); + CloseChildHandle(child); + _exit(exitcode); default: return -1; /* not reached */ } @@ -774,6 +777,7 @@ char **argv; char *cmd, *p, *q, *s, **t; int len, n, bs, quote; struct ChildRecord *child; + DWORD exitcode; switch (mode) { case P_WAIT: @@ -850,7 +854,9 @@ char **argv; return child->pid; case P_OVERLAY: WaitForSingleObject(child->hProcess, INFINITE); - exit(0); + GetExitCodeProcess(child->hProcess, &exitcode); + CloseChildHandle(child); + _exit(exitcode); default: return -1; /* not reached */ } |