mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 11:00:18 +01:00
logging: don't round subsecond part in logging timestamp
tv.tv_usec is guaranteed to have less then 6 digits, however rounding it up
we might reach 1000000 and thus the value becomes mis-aligned. To round
correctly, we would have to carry over a potential overflow to the seconds.
But that seems too much effort for little gain. Just truncate the value.
(cherry picked from commit c1b4b99a3c)
This commit is contained in:
parent
e9a0ce84a1
commit
99e30bdf70
1 changed files with 1 additions and 1 deletions
|
|
@ -512,7 +512,7 @@ _nm_log_impl (const char *file,
|
|||
va_end (args);
|
||||
|
||||
g_get_current_time (&tv);
|
||||
nm_sprintf_buf (s_buf_timestamp, " [%ld.%04ld]", tv.tv_sec, (tv.tv_usec + 50) / 100);
|
||||
nm_sprintf_buf (s_buf_timestamp, " [%ld.%04ld]", tv.tv_sec, tv.tv_usec / 100);
|
||||
|
||||
switch (global.log_backend) {
|
||||
#if SYSTEMD_JOURNAL
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue