Don't start the event processing thread until after forking.
[asterisk/asterisk.git] / main / asterisk.c
index 5cc0339..4636cf8 100644 (file)
@@ -2541,7 +2541,6 @@ int main(int argc, char *argv[])
        ast_alaw_init();
        callerid_init();
        ast_builtins_init();
-       ast_event_init();
        ast_utils_init();
        tdd_init();
        /* When Asterisk restarts after it has dropped the root privileges,
@@ -2841,6 +2840,8 @@ int main(int argc, char *argv[])
        if (test_for_thread_safety())
                ast_verbose("Warning! Asterisk is not thread safe.\n");
 
+       ast_event_init();
+
        ast_makesocket();
        sigemptyset(&sigs);
        sigaddset(&sigs, SIGHUP);