diff options
author | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2019-09-23 08:08:41 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-23 08:08:41 +0900 |
commit | b5902c506e958933bbabe6bdab8d676e0aa0bbc5 (patch) | |
tree | 6e55aaddcf693dc455ff72df20ec4d95bc43c02e /src/system | |
parent | 1c3d5fb3de037574667da4cfb022da319b89850d (diff) | |
download | DLT-daemon-b5902c506e958933bbabe6bdab8d676e0aa0bbc5.tar.gz |
dlt-system: Call tzset before localtime_r (#165)
Since localtime() was calling tzset() internally, it should be used
before localtime_r(). Refer to man page of localtime_r() for detail.
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
Diffstat (limited to 'src/system')
-rw-r--r-- | src/system/dlt-system-journal.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/system/dlt-system-journal.c b/src/system/dlt-system-journal.c index 6612988..aa9ba52 100644 --- a/src/system/dlt-system-journal.c +++ b/src/system/dlt-system-journal.c @@ -165,6 +165,7 @@ void dlt_system_journal_get_timestamp(sd_journal *journal, MessageTimestamp *tim } time_secs = (time_t)(time_usecs / 1000000); + tzset(); localtime_r(&time_secs, &timeinfo); strftime(buffer_realtime_formatted, sizeof(buffer_realtime_formatted), "%Y/%m/%d %H:%M:%S", &timeinfo); |