summaryrefslogtreecommitdiffstats
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-01 09:28:54 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-01 09:28:54 +0000
commit8e821c8828d3cb7d7d6c4127d3405f0fb30a36aa (patch)
tree3caee2aeccc078f23c6605e6b4378e289ecd5124 /win32
parent34421fdc29aacd66b87b599ef9c845e1c97e75c9 (diff)
downloadruby-8e821c8828d3cb7d7d6c4127d3405f0fb30a36aa.tar.gz
ruby-8e821c8828d3cb7d7d6c4127d3405f0fb30a36aa.tar.xz
ruby-8e821c8828d3cb7d7d6c4127d3405f0fb30a36aa.zip
* win32/win32.c (gettimeofday): shouldn't use mktime(2) because it's
buggy about handling summer time. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/win32/win32.c b/win32/win32.c
index c06aeffff..3c551cae0 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;