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/daemon | |
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/daemon')
-rw-r--r-- | src/daemon/dlt_daemon_client.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/daemon/dlt_daemon_client.c b/src/daemon/dlt_daemon_client.c index 2c05be3..eefed04 100644 --- a/src/daemon/dlt_daemon_client.c +++ b/src/daemon/dlt_daemon_client.c @@ -1464,6 +1464,7 @@ int dlt_daemon_control_message_timezone(int sock, DltDaemon *daemon, DltDaemonLo time_t t = time(NULL); struct tm lt; + tzset(); localtime_r(&t, <); #if !defined(__CYGWIN__) resp->timezone = (int32_t)lt.tm_gmtoff; @@ -2331,6 +2332,7 @@ int dlt_daemon_process_sixty_s_timer(DltDaemon *daemon, /*Added memset to avoid compiler warning for near initialization */ memset((void *)<, 0, sizeof(lt)); + tzset(); localtime_r(&t, <); dlt_daemon_control_message_timezone(DLT_DAEMON_SEND_TO_ALL, |