diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-01 09:28:54 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-01 09:28:54 +0000 |
commit | 4badcec903b143689d52f4ceaa5c80907098499a (patch) | |
tree | 3caee2aeccc078f23c6605e6b4378e289ecd5124 | |
parent | 8087f26de603639f4aca4c80007a825442fcf9c4 (diff) | |
download | ruby-4badcec903b143689d52f4ceaa5c80907098499a.tar.gz |
* win32/win32.c (gettimeofday): shouldn't use mktime(2) because it's
buggy about handling summer time.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | win32/win32.c | 13 |
2 files changed, 7 insertions, 11 deletions
@@ -1,3 +1,8 @@ +Mon Sep 1 18:27:51 2008 NAKAMURA Usaku <usa@ruby-lang.org> + + * win32/win32.c (gettimeofday): shouldn't use mktime(2) because it's + buggy about handling summer time. + Mon Sep 1 17:07:23 2008 NARUSE, Yui <naruse@ruby-lang.org> * enc/euc_jp.c (euc-jp-ms): euc-jp-ms is not an alias of EUC-JP diff --git a/win32/win32.c b/win32/win32.c index c06aeffff2..3c551cae04 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3089,19 +3089,10 @@ int _cdecl gettimeofday(struct timeval *tv, struct timezone *tz) { SYSTEMTIME st; - time_t t; struct tm tm; - GetLocalTime(&st); - tm.tm_sec = st.wSecond; - tm.tm_min = st.wMinute; - tm.tm_hour = st.wHour; - tm.tm_mday = st.wDay; - tm.tm_mon = st.wMonth - 1; - tm.tm_year = st.wYear - 1900; - tm.tm_isdst = -1; - t = mktime(&tm); - tv->tv_sec = t; + GetSystemTime(&st); + time(&tv->tv_sec); tv->tv_usec = st.wMilliseconds * 1000; return 0; |