summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-23 10:39:21 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-23 10:39:21 +0000
commitdd272b278d6e1d1a9ffeae299643e20f4a635e71 (patch)
tree6fac31034a5e57e5ae0621024a5b2daba4a51378
parentc6a9db3abb6d13c825a6763b1f7801855f5e593d (diff)
downloadruby-dd272b278d6e1d1a9ffeae299643e20f4a635e71.tar.gz
ruby-dd272b278d6e1d1a9ffeae299643e20f4a635e71.tar.xz
ruby-dd272b278d6e1d1a9ffeae299643e20f4a635e71.zip
* win32/win32.c (subtruct): check tv_sec. reported by ko1.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--win32/win32.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 4021f4c26..19b685f1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Sep 23 19:38:03 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (subtruct): check tv_sec. reported by ko1.
+
Tue Sep 23 19:21:03 2008 Tadayoshi Funaba <tadf@dotrb.org>
* complex.c (nucomp_s_canonicalize_internal): does no apply
diff --git a/win32/win32.c b/win32/win32.c
index 5774d0c50..bcf4bd77e 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -2157,6 +2157,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;