aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--win32/win32.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 0fc4186fff..0290b89825 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -4144,6 +4144,7 @@ waitpid(rb_pid_t pid, int *stat_loc, int options)
}
else {
struct ChildRecord* child = FindChildSlot(pid);
+ int retried = 0;
if (!child) {
errno = ECHILD;
return -1;
@@ -4157,8 +4158,10 @@ waitpid(rb_pid_t pid, int *stat_loc, int options)
pid = 0;
break;
}
+ ++retried;
}
}
+ if (pid == -1 && retried) pid = 0;
}
return pid;