From d51279d8627e069b9308bcfab3933e188a5277fc Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 13 Nov 2001 16:14:42 +0000 Subject: * win32/win32.c (waitpid): fix wait count. * win32/win32.c (poll_child_status): rename from wait_child(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/win32.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'win32/win32.c') diff --git a/win32/win32.c b/win32/win32.c index d0531a70d0..4b6f6665a8 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2270,7 +2270,7 @@ void setservent (int stayopen) {} #endif static pid_t -wait_child(struct ChildRecord *child, int *stat_loc, DWORD timeout) +poll_child_status(struct ChildRecord *child, int *stat_loc) { DWORD exitcode; @@ -2311,7 +2311,7 @@ waitpid (pid_t pid, int *stat_loc, int options) FOREACH_CHILD(child) { if (!child->pid || child->pid < 0) continue; - if ((pid = wait_child(child, stat_loc, 0))) return pid; + if ((pid = poll_child_status(child, stat_loc))) return pid; events[count++] = child->hProcess; } END_FOREACH_CHILD; if (!count) { @@ -2320,7 +2320,7 @@ waitpid (pid_t pid, int *stat_loc, int options) } events[count] = interrupted_event; - ret = WaitForMultipleEvents(count, events, FALSE, timeout, TRUE); + ret = WaitForMultipleEvents(count + 1, events, FALSE, timeout, TRUE); if (ret == WAIT_TIMEOUT) return 0; if ((ret -= WAIT_OBJECT_0) == count) { ResetSignal(interrupted_event); @@ -2332,7 +2332,7 @@ waitpid (pid_t pid, int *stat_loc, int options) return -1; } - return wait_child(ChildRecord + ret, stat_loc, 0); + return poll_child_status(ChildRecord + ret, stat_loc); } else { struct ChildRecord* child = FindChildSlot(pid); @@ -2341,7 +2341,7 @@ waitpid (pid_t pid, int *stat_loc, int options) return -1; } - while (!(pid = wait_child(child, stat_loc, timeout))) { + while (!(pid = poll_child_status(child, stat_loc))) { /* wait... */ if (wait_events(child->hProcess, timeout) != WAIT_OBJECT_0) { /* still active */ -- cgit v1.2.3