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

ruby-changes:8981

From: usa <ko1@a...>
Date: Thu, 4 Dec 2008 23:32:06 +0900 (JST)
Subject: [ruby-changes:8981] Ruby:r20517 (trunk, ruby_1_9_1): * win32/win32.c (waitpid): fix bug of checking child slot.

usa	2008-12-04 23:31:37 +0900 (Thu, 04 Dec 2008)

  New Revision: 20517

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

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

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/win32/win32.c
    trunk/ChangeLog
    trunk/win32/win32.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 20516)
+++ ChangeLog	(revision 20517)
@@ -1,3 +1,9 @@
+Thu Dec  4 23:29:34 2008  NAKAMURA Usaku  <usa@r...>
+
+	* win32/win32.c (waitpid): fix bug of checking child slot.
+
+	* win32/win32.c (FindChildSlotByHandle): new.
+
 Thu Dec  4 23:24:05 2008  Tanaka Akira  <akr@f...>
 
 	* lib/open3.rb (Open3.poutput3): new method.
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 20516)
+++ win32/win32.c	(revision 20517)
@@ -533,6 +533,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)
 {
@@ -3062,7 +3074,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);
Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 20516)
+++ ruby_1_9_1/ChangeLog	(revision 20517)
@@ -1,3 +1,9 @@
+Thu Dec  4 23:31:12 2008  NAKAMURA Usaku  <usa@r...>
+
+	* win32/win32.c (waitpid): fix bug of checking child slot.
+
+	* win32/win32.c (FindChildSlotByHandle): new.
+
 Thu Dec  4 16:58:12 2008  Yukihiro Matsumoto  <matz@r...>
 
 	* lib/rubygems/validator.rb (Gem#remove_leading_dot_dir): make
Index: ruby_1_9_1/win32/win32.c
===================================================================
--- ruby_1_9_1/win32/win32.c	(revision 20516)
+++ ruby_1_9_1/win32/win32.c	(revision 20517)
@@ -533,6 +533,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)
 {
@@ -3062,7 +3074,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/

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