X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fserver_main.c;h=9da255b50f1a8a54cb706122820b4b94e498aa56;hb=51ef89b985072d0bfe423c34575c8851aa16a606;hp=85cea680b1a67790d6e3236c11336aa8b6554f0b;hpb=561072a2d377311c5d00a62b56171bb8a13611c2;p=citadel.git diff --git a/citadel/server_main.c b/citadel/server_main.c index 85cea680b..9da255b50 100644 --- a/citadel/server_main.c +++ b/citadel/server_main.c @@ -1,92 +1,56 @@ /* * citserver's main() function lives here. + * + * Copyright (c) 1987-2014 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 version 3. + * + * 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. */ - -#include "sysdep.h" -#include -#include #include -#include -#include -#include #include -#include -#include -#include -#include - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#ifdef HAVE_PTHREAD_H -#include -#endif -#ifdef HAVE_SYS_PRCTL_H -#include -#endif #include -#include "citadel.h" -#include "server.h" -#include "serv_extensions.h" -#include "sysdep_decls.h" + #include "citserver.h" -#include "support.h" +#include "svn_revision.h" +#include "modules_init.h" #include "config.h" #include "control.h" -#include "database.h" +#include "serv_extensions.h" +#include "citadel_dirs.h" #include "user_ops.h" -#include "housekeeping.h" -#include "citadel_dirs.c" - -#include "modules_init.h" #include "ecrash.h" -#ifdef HAVE_SYS_SELECT_H -#include -#endif - -#ifndef HAVE_SNPRINTF -#include "snprintf.h" -#endif const char *CitadelServiceUDS="citadel-UDS"; const char *CitadelServiceTCP="citadel-TCP"; + + +void go_threading(void); + /* * Here's where it all begins. */ int main(int argc, char **argv) { + size_t basesize = 64; char facility[32]; - int a, i; /* General-purpose variables */ + int a; /* General-purpose variables */ 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; + const char *eDebuglist[] = {NULL, NULL}; #ifdef HAVE_RUN_DIR struct stat filestats; #endif @@ -94,75 +58,71 @@ 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 lprintf for thread safety - */ - CtdlInitBase64Table(); - InitialiseSemaphores(); - + /* initialize the master context */ InitializeMasterCC(); + InitializeMasterTSD(); /* parse command-line arguments */ - for (a=1; a