diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-09 06:38:16 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-09 06:38:16 +0000 |
commit | 5da516072ba2bec07bdffc02fabdc48dc8b3d7e6 (patch) | |
tree | ff2af3b9ff4ae5da976a2260c6b0dd16fbfea41c /win32 | |
parent | 0b44fa1e5006908406f32886f3f1f3898cb396a8 (diff) | |
download | ruby-5da516072ba2bec07bdffc02fabdc48dc8b3d7e6.tar.gz |
* win32/win32.c (waitpid): fixed return value of previous commit. thanks, nobu!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/win32/win32.c b/win32/win32.c index 1a37b61d3a..34995c54f6 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4296,10 +4296,11 @@ waitpid(rb_pid_t pid, int *stat_loc, int options) while (!(pid = poll_child_status(child, stat_loc))) { /* wait... */ - errno = 0; - if (rb_w32_wait_events_blocking(&child->hProcess, 1, timeout) != WAIT_OBJECT_0) { + int ret = rb_w32_wait_events_blocking(&child->hProcess, 1, timeout); + if (ret == WAIT_OBJECT_0 + 1) return -1; /* maybe EINTR */ + if (ret != WAIT_OBJECT_0) { /* still active */ - if ((options & WNOHANG) || errno == EINTR) { + if (options & WNOHANG) { pid = 0; break; } |