X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincd.c;h=951867643ea37fdcbcd79de305d4a5f493c944f4;hb=708825e4b229a4a1e182e682e2d1021fa2765396;hp=c4750da20c0c8b6991285a4ceeb25cea4778dd29;hpb=886a6f61a1f4cc48a77b42d10f34f9126377d904;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;