Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0703dba1
Commit
0703dba1
authored
May 24, 2001
by
heikki@donna.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ut0ut.c Rewrote ut_print_timestamp with localtime_r and in Win GetLocalTime
parent
125b4bd6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
innobase/ut/ut0ut.c
innobase/ut/ut0ut.c
+16
-14
No files found.
innobase/ut/ut0ut.c
View file @
0703dba1
...
...
@@ -57,25 +57,26 @@ ut_print_timestamp(
/*===============*/
FILE
*
file
)
/* in: file where to print */
{
struct
tm
*
cal_tm_ptr
;
struct
tm
cal_tm
;
time_t
tm
;
#ifdef __WIN__
SYSTEMTIME
cal_tm
;
try_again:
time
(
&
tm
);
GetLocalTime
(
&
cal_tm
);
cal_tm_ptr
=
localtime
(
&
tm
);
memcpy
(
&
cal_tm
,
cal_tm_ptr
,
sizeof
(
struct
tm
));
fprintf
(
file
,
"%02d%02d%02d %2d:%02d:%02d"
,
(
int
)
cal_tm
.
wYear
%
100
,
(
int
)
cal_tm
.
wMonth
,
(
int
)
cal_tm
.
wDay
,
(
int
)
cal_tm
.
wHour
,
(
int
)
cal_tm
.
wMinute
,
(
int
)
cal_tm
.
wSecond
);
#else
/* In theory localtime may return a wrong result because its return
struct is not protected with a mutex */
struct
tm
cal_tm
;
time_t
tm
;
if
(
difftime
(
tm
,
mktime
(
&
cal_tm
))
>
0
.
5
||
difftime
(
tm
,
mktime
(
&
cal_tm
))
<
-
0
.
5
)
{
time
(
&
tm
);
goto
try_again
;
}
localtime_r
(
&
tm
,
&
cal_tm
);
fprintf
(
file
,
"%02d%02d%02d %2d:%02d:%02d"
,
cal_tm
.
tm_year
%
100
,
...
...
@@ -84,6 +85,7 @@ ut_print_timestamp(
cal_tm
.
tm_hour
,
cal_tm
.
tm_min
,
cal_tm
.
tm_sec
);
#endif
}
/*****************************************************************
...
...
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