Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
8c954c09
Commit
8c954c09
authored
Mar 29, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Avoid using localtime_r.
parent
8a57f501
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
time.c
dlls/msvcrt/time.c
+12
-3
No files found.
dlls/msvcrt/time.c
View file @
8c954c09
...
...
@@ -32,6 +32,7 @@
#include <limits.h>
#include "msvcrt.h"
#include "mtdll.h"
#include "winbase.h"
#include "winnls.h"
#include "wine/debug.h"
...
...
@@ -127,16 +128,21 @@ MSVCRT___time32_t CDECL MSVCRT_mktime(struct MSVCRT_tm *mstm)
*/
struct
MSVCRT_tm
*
CDECL
MSVCRT__localtime64
(
const
MSVCRT___time64_t
*
secs
)
{
struct
tm
tm
;
struct
tm
*
tm
;
thread_data_t
*
data
;
time_t
seconds
=
*
secs
;
if
(
seconds
<
0
)
return
NULL
;
if
(
!
localtime_r
(
&
seconds
,
&
tm
))
return
NULL
;
_mlock
(
_TIME_LOCK
);
if
(
!
(
tm
=
localtime
(
&
seconds
)))
{
_munlock
(
_TIME_LOCK
);
return
NULL
;
}
data
=
msvcrt_get_thread_data
();
unix_tm_to_msvcrt
(
&
data
->
time_buffer
,
&
tm
);
unix_tm_to_msvcrt
(
&
data
->
time_buffer
,
tm
);
_munlock
(
_TIME_LOCK
);
return
&
data
->
time_buffer
;
}
...
...
@@ -492,12 +498,15 @@ void CDECL MSVCRT__tzset(void)
struct
tm
*
tmp
;
int
zone_january
,
zone_july
;
_mlock
(
_TIME_LOCK
);
t
=
(
time
(
NULL
)
/
seconds_in_year
)
*
seconds_in_year
;
tmp
=
localtime
(
&
t
);
zone_january
=
-
tmp
->
tm_gmtoff
;
t
+=
seconds_in_year
/
2
;
tmp
=
localtime
(
&
t
);
zone_july
=
-
tmp
->
tm_gmtoff
;
_munlock
(
_TIME_LOCK
);
MSVCRT___daylight
=
(
zone_january
!=
zone_july
);
MSVCRT___timezone
=
max
(
zone_january
,
zone_july
);
}
...
...
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