[前][次][番号順一覧][スレッド一覧]

ruby-changes:9001

From: usa <ko1@a...>
Date: Fri, 5 Dec 2008 12:52:15 +0900 (JST)
Subject: [ruby-changes:9001] Ruby:r20537 (ruby_1_8): * win32/win32.c (waitpid): fix bug of checking child slot.

usa	2008-12-05 12:52:06 +0900 (Fri, 05 Dec 2008)

  New Revision: 20537

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20537

  Log:
    * win32/win32.c (waitpid): fix bug of checking child slot.
    * win32/win32.c (FindChildSlotByHandle): new.

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/win32/win32.c

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 20536)
+++ ruby_1_8/ChangeLog	(revision 20537)
@@ -1,3 +1,9 @@
+Fri Dec  5 12:49:24 2008  NAKAMURA Usaku  <usa@r...>
+
+	* 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@r...>
 
 	* string.c (rb_str_cmp_m): fixed rdoc.  pointed out by <Thomas
Index: ruby_1_8/win32/win32.c
===================================================================
--- ruby_1_8/win32/win32.c	(revision 20536)
+++ ruby_1_8/win32/win32.c	(revision 20537)
@@ -514,6 +514,18 @@
     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 @@
 	    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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]