* 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
This commit is contained in:
usa 2015-07-09 06:38:16 +00:00
parent fcb79d5324
commit b3544b2551

View File

@ -4296,10 +4296,11 @@ waitpid(rb_pid_t pid, int *stat_loc, int options)
while (!(pid = poll_child_status(child, stat_loc))) { while (!(pid = poll_child_status(child, stat_loc))) {
/* wait... */ /* wait... */
errno = 0; int ret = rb_w32_wait_events_blocking(&child->hProcess, 1, timeout);
if (rb_w32_wait_events_blocking(&child->hProcess, 1, timeout) != WAIT_OBJECT_0) { if (ret == WAIT_OBJECT_0 + 1) return -1; /* maybe EINTR */
if (ret != WAIT_OBJECT_0) {
/* still active */ /* still active */
if ((options & WNOHANG) || errno == EINTR) { if (options & WNOHANG) {
pid = 0; pid = 0;
break; break;
} }