--- a/src/main.c +++ b/src/main.c @@ -219,6 +219,16 @@ static int check_ipv6() */ int main(int argc,char *argv[]) { +#if DEBUG>0 + { + int err; + /* Generate a key for storing our thread id's */ + if ((err=pthread_key_create(&thrid_key, NULL)) != 0) { + log_error("pthread_key_create failed: %s",strerror(err)); + _exit(1); + } + } +#endif int i,sig,pfd=-1; /* Initialized to inhibit compiler warning */ main_thrid=pthread_self(); @@ -626,17 +636,6 @@ int main(int argc,char *argv[]) pthread_sigmask(SIG_BLOCK,&sigs_msk,NULL); #endif -#if DEBUG>0 - { - int err; - /* Generate a key for storing our thread id's */ - if ((err=pthread_key_create(&thrid_key, NULL)) != 0) { - log_error("pthread_key_create failed: %s",strerror(err)); - _exit(1); - } - } -#endif - { #if DEBUG>0 int thrdsucc=1;