diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-17 08:13:33 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-17 08:13:33 +0000 |
commit | bd929bb48aa0daa237cbda73bef33c0c6adc75fd (patch) | |
tree | ec00215c9585e6350119f18be8e8ccf8d5d001f3 /win32 | |
parent | 510bdd1502aae4f154af20a390c83578b866fd20 (diff) |
merge revision(s) 51202,51203,51204: [Backport #11340]
* win32/win32.c (waitpid): return immediately if interrupted.
reported by <takkanm AT gmail.com> [ruby-dev:49176] [Bug #11340]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@51607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c index 203e21b09f..f19c097abd 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4265,7 +4265,9 @@ waitpid(rb_pid_t pid, int *stat_loc, int options) while (!(pid = poll_child_status(child, stat_loc))) { /* wait... */ - 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) { pid = 0; |