X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincd.c;h=951867643ea37fdcbcd79de305d4a5f493c944f4;hb=6834b882015a9323672e9fce8811aa4283f196f0;hp=c4750da20c0c8b6991285a4ceeb25cea4778dd29;hpb=a22041922f160667573e9a5ae3f4195e1668906a;p=tinc diff --git a/src/tincd.c b/src/tincd.c index c4750da2..95186764 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -110,6 +110,8 @@ static struct option const long_options[] = { {NULL, 0, NULL, 0} }; +mutex_t mutex; + #ifdef HAVE_MINGW static struct WSAData wsa_state; CRITICAL_SECTION mutex; @@ -381,13 +383,11 @@ int main(int argc, char **argv) { openlogger("tinc", use_logfile?LOGMODE_FILE:LOGMODE_STDERR); - if(!event_init()) { - logger(LOG_ERR, "Error initializing libevent!"); - return 1; - } - g_argv = argv; + mutex_create(&mutex); + mutex_lock(&mutex); + init_events(); init_configuration(&config_tree); /* Slllluuuuuuurrrrp! */ @@ -495,6 +495,7 @@ end: crypto_exit(); exit_configuration(&config_tree); + exit_events(); free_names(); return status;