]> code.citadel.org Git - citadel.git/blobdiff - citadel/server_main.c
Patches from Matt with slight mod from me to do without strlen. Also modified lprintf...
[citadel.git] / citadel / server_main.c
index e4c72ab42591308dbcd2cb46fe284b711e393c2e..4c69e608342f9c9c3af4aa9cdc653f77f279b3fa 100644 (file)
@@ -58,6 +58,9 @@
 #include "tools.h"
 #include "citadel_dirs.c"
 
+#include "modules_init.h"
+
+
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
@@ -66,8 +69,6 @@
 #include "snprintf.h"
 #endif
 
-int running_as_daemon = 0;
-
 /*
  * Here's where it all begins.
  */
@@ -86,6 +87,11 @@ int main(int argc, char **argv)
 #ifdef HAVE_RUN_DIR
        struct stat filestats;
 #endif
+
+       /* initialise semaphores here. Patch by Matt and davew
+        * its called here as they are needed by lprintf for thread safety
+        */
+       InitialiseSemaphores();
        
        /* initialize the master context */
        InitializeMasterCC();
@@ -235,7 +241,14 @@ int main(int argc, char **argv)
         */
        lprintf(CTDL_INFO, "Initializing server extensions\n");
        size = strlen(ctdl_home_directory) + 9;
+       
+/*
        initialize_server_extensions();
+*/
+       
+       initialise_modules();
+       
+       
 
        /*
         * If we need host auth, start our chkpwd daemon.
@@ -289,7 +302,7 @@ int main(int argc, char **argv)
        }
        end_critical_section(S_WORKER_LIST);
 
-       /* Create the indexer thread. */
+       /* Create the maintenance threads. */
        create_maintenance_threads();
 
        /* This thread is now useless.  It can't be turned into a worker