Commit 874b8a3e authored by Rein Klazes's avatar Rein Klazes Committed by Alexandre Julliard

Corrected a problem in GetTimeZoneInformation() due a change to

mktime() in glibc-2.1.1 when daylight saving time is in effect.
parent e22a4e57
...@@ -103,11 +103,19 @@ BOOL WINAPI SetSystemTime(const SYSTEMTIME *systime) ...@@ -103,11 +103,19 @@ BOOL WINAPI SetSystemTime(const SYSTEMTIME *systime)
DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION tzinfo) DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION tzinfo)
{ {
time_t gmt, lt; time_t gmt, lt;
struct tm *ptm;
int daylight;
memset(tzinfo, 0, sizeof(TIME_ZONE_INFORMATION)); memset(tzinfo, 0, sizeof(TIME_ZONE_INFORMATION));
gmt = time(NULL); gmt = time(NULL);
lt = mktime(gmtime(&gmt)); ptm=localtime(&gmt);
daylight=ptm->tm_isdst;
ptm = gmtime(&gmt);
ptm->tm_isdst=daylight;
lt = mktime(ptm);
tzinfo->Bias = (lt - gmt) / 60; tzinfo->Bias = (lt - gmt) / 60;
tzinfo->StandardBias = 0; tzinfo->StandardBias = 0;
tzinfo->DaylightBias = -60; tzinfo->DaylightBias = -60;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment