diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-18 13:24:00 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-18 13:24:00 +0000 |
commit | fbcc4cffc2c7fef8d56bedd947fd06ffc1e3a489 (patch) | |
tree | 6b3583e0f8de0c83bbda01e15d53a4c3b72a363a /win32 | |
parent | 0dd0550b612364dacefd3d3a88b0e0b34230e3c4 (diff) | |
download | ruby-fbcc4cffc2c7fef8d56bedd947fd06ffc1e3a489.tar.gz ruby-fbcc4cffc2c7fef8d56bedd947fd06ffc1e3a489.tar.xz ruby-fbcc4cffc2c7fef8d56bedd947fd06ffc1e3a489.zip |
merge revision(s) 20537:
* win32/win32.c (waitpid): fix bug of checking child slot.
* win32/win32.c (FindChildSlotByHandle): new.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_6@22412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c index 3b49ecaa8..5fd467838 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); |