Switched back to the old style thread architecture in preparation for eventual migrat...
[citadel.git] / citadel / server_main.c
index cc45704669cc60f80dafb8300bb0c5e57b007ff6..58a397afee87cf6645169b2236110c7789087cbe 100644 (file)
@@ -116,13 +116,9 @@ int main(int argc, char **argv)
 //     eCrashSymbolTable symbol_table;
 #endif
 
-       /* initialise semaphores here. Patch by Matt and davew
-        * its called here as they are needed by syslog for thread safety
-        */
-       InitialiseSemaphores();
-       
        /* initialize the master context */
        InitializeMasterCC();
+       InitializeMasterTSD();
 
        /* parse command-line arguments */
        for (a=1; a<argc; ++a) {
@@ -216,25 +212,25 @@ int main(int argc, char **argv)
 #endif
 
        /* Tell 'em who's in da house */
-       syslog(LOG_NOTICE, "\n");
-       syslog(LOG_NOTICE, "\n");
+       syslog(LOG_NOTICE, " ");
+       syslog(LOG_NOTICE, " ");
        syslog(LOG_NOTICE,
-               "*** Citadel server engine v%d.%02d (build %s) ***\n",
+               "*** Citadel server engine v%d.%02d (build %s) ***",
                (REV_LEVEL/100), (REV_LEVEL%100), svn_revision());
-       syslog(LOG_NOTICE, "Copyright (C) 1987-2010 by the Citadel development team.\n");
+       syslog(LOG_NOTICE, "Copyright (C) 1987-2011 by the Citadel development team.");
        syslog(LOG_NOTICE, "This program is distributed under the terms of the GNU "
-                                       "General Public License.\n");
-       syslog(LOG_NOTICE, "\n");
-       syslog(LOG_DEBUG, "Called as: %s\n", argv[0]);
-       syslog(LOG_INFO, "%s\n", libcitadel_version_string());
+                                       "General Public License.");
+       syslog(LOG_NOTICE, " ");
+       syslog(LOG_DEBUG, "Called as: %s", argv[0]);
+       syslog(LOG_INFO, "%s", libcitadel_version_string());
 
        /* Load site-specific parameters, and set the ipgm secret */
-       syslog(LOG_INFO, "Loading citadel.config\n");
+       syslog(LOG_INFO, "Loading citadel.config");
        get_config();
        config.c_ipgm_secret = rand();
 
        /* get_control() MUST MUST MUST be called BEFORE the databases are opened!! */
-       syslog(LOG_INFO, "Acquiring control record\n");
+       syslog(LOG_INFO, "Acquiring control record");
        get_control();
 
        put_config();
@@ -283,18 +279,18 @@ int main(int argc, char **argv)
        /*
         * Run any upgrade entry points
         */
-       syslog(LOG_INFO, "Upgrading modules.\n");
+       syslog(LOG_INFO, "Upgrading modules.");
        upgrade_modules();
        
-/**
+/*
  * Load the user for the masterCC or create them if they don't exist
  */
        if (CtdlGetUser(&masterCC.user, "SYS_Citadel"))
        {
-               /** User doesn't exist. We can't use create user here as the user number needs to be 0 */
+               /* User doesn't exist. We can't use create user here as the user number needs to be 0 */
                strcpy (masterCC.user.fullname, "SYS_Citadel") ;
                CtdlPutUser(&masterCC.user);
-               CtdlGetUser(&masterCC.user, "SYS_Citadel"); /** Just to be safe */
+               CtdlGetUser(&masterCC.user, "SYS_Citadel"); /* Just to be safe */
        }
        
        /*