diff --git a/ChangeLog b/ChangeLog index 62948e94d2..c3e0d37fa5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Sep 23 19:50:24 2008 NAKAMURA Usaku + + * win32/win32.c (subtruct): check tv_sec. + Tue Sep 23 19:30:41 2008 NAKAMURA Usaku * win32/win32.c (filetime_to_timeval): new function, split from diff --git a/win32/win32.c b/win32/win32.c index 6bd5a0694e..98cb7bb6bc 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2172,6 +2172,9 @@ do_select(int nfds, fd_set *rd, fd_set *wr, fd_set *ex, static inline int subtract(struct timeval *rest, const struct timeval *wait) { + if (rest->tv_sec < wait->tv_sec) { + return 0; + } while (rest->tv_usec < wait->tv_usec) { if (rest->tv_sec <= wait->tv_sec) { return 0;