aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-01-28 11:13:32 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-01-28 11:13:32 +0100
commit0aaa6989c86eb6f15f49faee7ab0c013ebe89171 (patch)
treea4381f5c2261145a26e596cf82e009a209c91f54 /src/utils.cpp
parentc823c87d6f286310e9efd9e723f2e14c3320d31f (diff)
downloaddabmux-0aaa6989c86eb6f15f49faee7ab0c013ebe89171.tar.gz
dabmux-0aaa6989c86eb6f15f49faee7ab0c013ebe89171.tar.bz2
dabmux-0aaa6989c86eb6f15f49faee7ab0c013ebe89171.zip
Use reentrant gmtime and localtime functions, and other tweaks
Diffstat (limited to 'src/utils.cpp')
-rw-r--r--src/utils.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/utils.cpp b/src/utils.cpp
index be3cfd3..7a922fe 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -536,8 +536,9 @@ void printEnsemble(const shared_ptr<dabEnsemble>& ensemble)
if (ensemble->lto_auto) {
time_t now = time(nullptr);
- struct tm* ltime = localtime(&now);
- time_t now2 = timegm(ltime);
+ struct tm ltime;
+ localtime_r(&now, &ltime);
+ time_t now2 = timegm(&ltime);
etiLog.log(info, " lto: %2.1f hours", 0.5 * (now2 - now) / 1800);
}
else {