Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
85c427f4
Unverified
Commit
85c427f4
authored
Aug 25, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
b1401e3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
log.c
src/lxc/log.c
+4
-4
No files found.
src/lxc/log.c
View file @
85c427f4
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
* datatype is currently at maximum a 64bit integer, we have a date string that
* datatype is currently at maximum a 64bit integer, we have a date string that
* is of maximum length (2^64 - 1) * 2 = (21 + 21) = 42.
* is of maximum length (2^64 - 1) * 2 = (21 + 21) = 42.
*/
*/
#define LXC_LOG_TIME_SIZE ((
LXC_NUMSTRLEN64)*
2)
#define LXC_LOG_TIME_SIZE ((
INTTYPE_TO_STRLEN(uint64_t)) *
2)
int
lxc_log_fd
=
-
1
;
int
lxc_log_fd
=
-
1
;
static
int
syslog_enable
=
0
;
static
int
syslog_enable
=
0
;
...
@@ -170,7 +170,7 @@ static int lxc_unix_epoch_to_utc(char *buf, size_t bufsize, const struct timespe
...
@@ -170,7 +170,7 @@ static int lxc_unix_epoch_to_utc(char *buf, size_t bufsize, const struct timespe
{
{
int64_t
epoch_to_days
,
z
,
era
,
doe
,
yoe
,
year
,
doy
,
mp
,
day
,
month
,
int64_t
epoch_to_days
,
z
,
era
,
doe
,
yoe
,
year
,
doy
,
mp
,
day
,
month
,
d_in_s
,
hours
,
h_in_s
,
minutes
,
seconds
;
d_in_s
,
hours
,
h_in_s
,
minutes
,
seconds
;
char
nanosec
[
LXC_NUMSTRLEN64
];
char
nanosec
[
INTTYPE_TO_STRLEN
(
int64_t
)
];
int
ret
;
int
ret
;
/* See https://howardhinnant.github.io/date_algorithms.html for an
/* See https://howardhinnant.github.io/date_algorithms.html for an
...
@@ -247,8 +247,8 @@ static int lxc_unix_epoch_to_utc(char *buf, size_t bufsize, const struct timespe
...
@@ -247,8 +247,8 @@ static int lxc_unix_epoch_to_utc(char *buf, size_t bufsize, const struct timespe
seconds
=
(
time
->
tv_sec
-
d_in_s
-
h_in_s
-
(
minutes
*
60
));
seconds
=
(
time
->
tv_sec
-
d_in_s
-
h_in_s
-
(
minutes
*
60
));
/* Make string from nanoseconds. */
/* Make string from nanoseconds. */
ret
=
snprintf
(
nanosec
,
LXC_NUMSTRLEN64
,
"%"
PRId64
,
(
int64_t
)
time
->
tv_nsec
);
ret
=
snprintf
(
nanosec
,
INTTYPE_TO_STRLEN
(
int64_t
)
,
"%"
PRId64
,
(
int64_t
)
time
->
tv_nsec
);
if
(
ret
<
0
||
ret
>=
LXC_NUMSTRLEN64
)
if
(
ret
<
0
||
ret
>=
INTTYPE_TO_STRLEN
(
int64_t
)
)
return
-
1
;
return
-
1
;
/* Create final timestamp for the log and shorten nanoseconds to 3
/* Create final timestamp for the log and shorten nanoseconds to 3
...
...
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