From 98b8e7eb70ffea8c781103f6e9b99e05969a92b4 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Wed, 18 Feb 2009 13:24:00 +0000 Subject: merge revision(s) 20537: * 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_6@22412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ version.h | 2 +- win32/win32.c | 14 +++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 254be5e399..eac1565bd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Feb 18 22:23:44 2009 NAKAMURA Usaku + + * win32/win32.c (waitpid): fix bug of checking child slot. + + * win32/win32.c (FindChildSlotByHandle): new. + Wed Feb 18 22:12:24 2009 Yukihiro Matsumoto * pack.c (pack_pack): propagate taint status from format string to diff --git a/version.h b/version.h index e01e5cfd99..699bfc9524 100644 --- a/version.h +++ b/version.h @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2009-02-18" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20090218 -#define RUBY_PATCHLEVEL 339 +#define RUBY_PATCHLEVEL 340 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 diff --git a/win32/win32.c b/win32/win32.c index 3b49ecaa85..5fd4678383 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -520,6 +520,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) { @@ -2784,7 +2796,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); -- cgit v1.2.3