From 3bd735314dd2d59a1f4b5c48c06cda77453a31a6 Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 23 Sep 2008 10:50:42 +0000 Subject: [PATCH] * win32/win32.c (subtruct): check tv_sec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@19486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ win32/win32.c | 3 +++ 2 files changed, 7 insertions(+) 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;