aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--win32/win32.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 566a209bda..2227df2a95 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jun 20 02:44:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (waitpid): should not return 0 but wait until exit
+ unless WNOHANG is given. waiting huge process may return while
+ active, for some reason.
+
Thu Jun 20 01:34:15 2013 Tanaka Akira <akr@fsij.org>
* bignum.c (bdigit_roomof): Use SIZEOF_BDIGITS.
diff --git a/win32/win32.c b/win32/win32.c
index 7b42df096f..0fc4186fff 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -4153,8 +4153,10 @@ waitpid(rb_pid_t pid, int *stat_loc, int options)
/* wait... */
if (rb_w32_wait_events_blocking(&child->hProcess, 1, timeout) != WAIT_OBJECT_0) {
/* still active */
- pid = 0;
- break;
+ if (options & WNOHANG) {
+ pid = 0;
+ break;
+ }
}
}
}