Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
0e44bda7
Commit
0e44bda7
authored
Oct 18, 2011
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Take into account timezone bias changes when detecting daylight saving rules.
parent
c8ecf2c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
time.c
dlls/ntdll/time.c
+10
-9
No files found.
dlls/ntdll/time.c
View file @
0e44bda7
...
...
@@ -728,18 +728,20 @@ static time_t find_dst_change(unsigned long min, unsigned long max, int *is_dst)
static
int
init_tz_info
(
RTL_TIME_ZONE_INFORMATION
*
tzi
)
{
static
RTL_TIME_ZONE_INFORMATION
cached_tzi
;
static
int
current_year
=
-
1
;
static
int
current_year
=
-
1
,
current_bias
=
65535
;
struct
tm
*
tm
;
time_t
year_start
,
year_end
,
tmp
,
dlt
=
0
,
std
=
0
;
int
is_dst
,
current_is_dst
;
int
is_dst
,
current_is_dst
,
bias
;
RtlEnterCriticalSection
(
&
TIME_tz_section
);
year_start
=
time
(
NULL
);
tm
=
localtime
(
&
year_start
);
tm
=
gmtime
(
&
year_start
);
bias
=
(
LONG
)(
mktime
(
tm
)
-
year_start
)
/
60
;
tm
=
localtime
(
&
year_start
);
current_is_dst
=
tm
->
tm_isdst
;
if
(
current_year
==
tm
->
tm_year
)
if
(
current_year
==
tm
->
tm_year
&&
current_bias
==
bias
)
{
*
tzi
=
cached_tzi
;
RtlLeaveCriticalSection
(
&
TIME_tz_section
);
...
...
@@ -748,8 +750,11 @@ static int init_tz_info(RTL_TIME_ZONE_INFORMATION *tzi)
memset
(
tzi
,
0
,
sizeof
(
*
tzi
));
TRACE
(
"tz data will be valid through year %d
\n
"
,
tm
->
tm_year
+
1900
);
TRACE
(
"tz data will be valid through year %d
, bias %d
\n
"
,
tm
->
tm_year
+
1900
,
bias
);
current_year
=
tm
->
tm_year
;
current_bias
=
bias
;
tzi
->
Bias
=
bias
;
tm
->
tm_isdst
=
0
;
tm
->
tm_mday
=
1
;
...
...
@@ -764,10 +769,6 @@ static int init_tz_info(RTL_TIME_ZONE_INFORMATION *tzi)
year_end
=
mktime
(
tm
);
TRACE
(
"year_end: %s"
,
ctime
(
&
year_end
));
tm
=
gmtime
(
&
year_start
);
tzi
->
Bias
=
(
LONG
)(
mktime
(
tm
)
-
year_start
)
/
60
;
TRACE
(
"bias: %d
\n
"
,
tzi
->
Bias
);
tmp
=
find_dst_change
(
year_start
,
year_end
,
&
is_dst
);
if
(
is_dst
)
dlt
=
tmp
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment