summaryrefslogtreecommitdiff
path: root/src/shared/dlt_common.c
diff options
context:
space:
mode:
authorSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2019-09-23 08:08:41 +0900
committerGitHub <noreply@github.com>2019-09-23 08:08:41 +0900
commitb5902c506e958933bbabe6bdab8d676e0aa0bbc5 (patch)
tree6e55aaddcf693dc455ff72df20ec4d95bc43c02e /src/shared/dlt_common.c
parent1c3d5fb3de037574667da4cfb022da319b89850d (diff)
downloadDLT-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/shared/dlt_common.c')
-rw-r--r--src/shared/dlt_common.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c
index 8a538e8..4b56fc1 100644
--- a/src/shared/dlt_common.c
+++ b/src/shared/dlt_common.c
@@ -640,6 +640,7 @@ DltReturnValue dlt_message_header_flags(DltMessage *msg, char *text, int textlen
if ((flags & DLT_HEADER_SHOW_TIME) == DLT_HEADER_SHOW_TIME) {
/* print received time */
time_t tt = msg->storageheader->seconds;
+ tzset();
localtime_r(&tt, &timeinfo);
strftime (buffer, sizeof(buffer), "%Y/%m/%d %H:%M:%S", &timeinfo);
snprintf(text, textlength, "%s.%.6d ", buffer, msg->storageheader->microseconds);