summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-12 14:55:00 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-12 14:55:00 +0000
commit388215e32396b1a67bab2849951f48ffc68dfb19 (patch)
tree9b0def0ce8951302c2b23f0bdadfacdd3cf7dc0c /win32
parent3a78ff203c628b9a5a9edb2794e2910600cff723 (diff)
downloadruby-388215e32396b1a67bab2849951f48ffc68dfb19.tar.gz
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_2@51552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index fc2c99edf1..eb1818affa 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -4297,7 +4297,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;