diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | win32/win32.c | 10 |
2 files changed, 11 insertions, 5 deletions
@@ -1,3 +1,9 @@ +Wed Nov 14 01:12:07 2001 Usaku Nakamura <usa@ruby-lang.org> + + * win32/win32.c (waitpid): fix wait count. + + * win32/win32.c (poll_child_status): rename from wait_child(). + Tue Nov 13 19:50:30 2001 WATANABE Hirofumi <eban@ruby-lang.org> * configure.in: do not override CC if set. 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 */ |