X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fserver_main.c;h=55ec9f578ee07e6f9923d394b23592861dfcbe06;hb=200b7ef90a77a4fd2f7239de7d393d2f577233a4;hp=a0d7b31f742a0ed1a19d52d7bd18fdd35a8b3d64;hpb=3eda0116bacbea7ab2a3933f380cd1cdd0831b57;p=citadel.git diff --git a/citadel/server_main.c b/citadel/server_main.c index a0d7b31f7..55ec9f578 100644 --- a/citadel/server_main.c +++ b/citadel/server_main.c @@ -1,7 +1,21 @@ /* * citserver's main() function lives here. + * + * Copyright (c) 1987-2011 by the citadel.org team * - * $Id$ + * This program is open source software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "sysdep.h" @@ -54,7 +68,10 @@ #include "database.h" #include "user_ops.h" #include "housekeeping.h" -#include "citadel_dirs.c" +#include "svn_revision.h" +#include "citadel_dirs.h" + +#include "context.h" #include "modules_init.h" #include "ecrash.h" @@ -70,8 +87,8 @@ const char *CitadelServiceUDS="citadel-UDS"; const char *CitadelServiceTCP="citadel-TCP"; -void go_threading(void); +void go_threading(void); /* * Here's where it all begins. @@ -83,12 +100,12 @@ int main(int argc, char **argv) struct passwd pw, *pwp = NULL; char pwbuf[SIZ]; int drop_root_perms = 1; - size_t size; int relh=0; int home=0; int dbg=0; char relhome[PATH_MAX]=""; char ctdldir[PATH_MAX]=CTDLDIR; + int syslog_facility = LOG_DAEMON; #ifdef HAVE_RUN_DIR struct stat filestats; #endif @@ -96,14 +113,10 @@ int main(int argc, char **argv) eCrashParameters params; // eCrashSymbolTable symbol_table; #endif - /* initialise semaphores here. Patch by Matt and davew - * its called here as they are needed by CtdlLogPrintf for thread safety - */ - CtdlInitBase64Table(); - InitialiseSemaphores(); - + /* initialize the master context */ InitializeMasterCC(); + InitializeMasterTSD(); /* parse command-line arguments */ for (a=1; a