diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-19 17:44:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-19 17:44:47 +0000 |
commit | 4c25e2fb8ba17a4d83f3e55c6ddfa5ae417d1f7c (patch) | |
tree | 5105208dec7552dda1920700e29a60f95b96bece /win32/win32.c | |
parent | a5b0cace63a0806859c106d7c847f447bdf7ca7b (diff) |
win32.c: wait until exit
* win32/win32.c (waitpid): should not return 0 but wait until exit
unless WNOHANG is given. waiting huge process may return while
active, for some reason.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c index 7b42df096f..0fc4186fff 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4153,8 +4153,10 @@ waitpid(rb_pid_t pid, int *stat_loc, int options) /* wait... */ if (rb_w32_wait_events_blocking(&child->hProcess, 1, timeout) != WAIT_OBJECT_0) { /* still active */ - pid = 0; - break; + if (options & WNOHANG) { + pid = 0; + break; + } } } } |