summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-05 03:52:06 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-05 03:52:06 +0000
commit523d90905d95fdd6bedbd4e74faf4e61795402f7 (patch)
treeb27570f974e29bd5f34e38ed27c40d7e3cf9bd00
parent8c0efdc182eb66a72eb04132060fa15df2ab6360 (diff)
* win32/win32.c (waitpid): fix bug of checking child slot.
* win32/win32.c (FindChildSlotByHandle): new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--win32/win32.c14
2 files changed, 19 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index db2e16b428..8a59bf9cca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Dec 5 12:49:24 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (waitpid): fix bug of checking child slot.
+
+ * win32/win32.c (FindChildSlotByHandle): new.
+
Fri Dec 5 10:01:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (rb_str_cmp_m): fixed rdoc. pointed out by <Thomas
diff --git a/win32/win32.c b/win32/win32.c
index 791071d9d0..9d46bf0d6d 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -514,6 +514,18 @@ FindChildSlot(rb_pid_t pid)
return NULL;
}
+static struct ChildRecord *
+FindChildSlotByHandle(HANDLE h)
+{
+
+ FOREACH_CHILD(child) {
+ if (child->hProcess == h) {
+ return child;
+ }
+ } END_FOREACH_CHILD;
+ return NULL;
+}
+
static void
CloseChildHandle(struct ChildRecord *child)
{
@@ -2967,7 +2979,7 @@ waitpid(rb_pid_t pid, int *stat_loc, int options)
return -1;
}
- return poll_child_status(ChildRecord + ret, stat_loc);
+ return poll_child_status(FindChildSlotByHandle(events[ret]), stat_loc);
}
else {
struct ChildRecord* child = FindChildSlot(pid);