From 1478ff198878db23e8417aecfc936e31e3e9bec9 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sat, 25 Feb 2017 12:13:03 +0100 Subject: Move setenv earlier the glibc manual says in chapter 25.4.1 Environment Access 'Modifications of environment variables are not allowed in multi-threaded programs.' So we do it before we become multi-threaded. --- src/DabMod.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/DabMod.cpp b/src/DabMod.cpp index 741ac73..bc3ee30 100644 --- a/src/DabMod.cpp +++ b/src/DabMod.cpp @@ -209,10 +209,6 @@ int launch_modulator(int argc, char* argv[]) return EXIT_FAILURE; } - // Set timezone to UTC - setenv("TZ", "", 1); - tzset(); - while (true) { int c = getopt(argc, argv, "a:C:c:f:F:g:G:hlm:o:O:r:T:u:V"); if (c == -1) { @@ -1015,6 +1011,10 @@ run_modulator_state_t run_modulator(modulator_data& m) int main(int argc, char* argv[]) { + // Set timezone to UTC + setenv("TZ", "", 1); + tzset(); + try { return launch_modulator(argc, argv); } -- cgit v1.2.3