From fcb79d5324e2fc3f5943d5d61f44c4d0640965e1 Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 9 Jul 2015 06:10:47 +0000 Subject: [PATCH] * win32/win32.c (waitpid): return immediately if interrupted. reported by [ruby-dev:49176] [Bug #11340] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ win32/win32.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 65d24dce28..694edeb893 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jul 9 15:07:12 2015 NAKAMURA Usaku + + * win32/win32.c (waitpid): return immediately if interrupted. + reported by [ruby-dev:49176] [Bug #11340] + Thu Jul 9 13:03:46 2015 Koichi Sasada * vm_insnhelper.c (vm_search_super_method): use CI_SET_FASTPATH(). diff --git a/win32/win32.c b/win32/win32.c index b8563aad2c..1a37b61d3a 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4296,9 +4296,10 @@ 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) { /* still active */ - if (options & WNOHANG) { + if ((options & WNOHANG) || errno == EINTR) { pid = 0; break; }