aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-02-25 12:13:03 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-02-25 12:13:03 +0100
commit1478ff198878db23e8417aecfc936e31e3e9bec9 (patch)
treec6076e3a2d1cb56c1961e0eaa00f814fe24e176b
parent8eb2b6842570af606c797d1bc8da55bb27487b99 (diff)
downloaddabmod-1478ff198878db23e8417aecfc936e31e3e9bec9.tar.gz
dabmod-1478ff198878db23e8417aecfc936e31e3e9bec9.tar.bz2
dabmod-1478ff198878db23e8417aecfc936e31e3e9bec9.zip
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.
-rw-r--r--src/DabMod.cpp8
1 files 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);
}