X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=server.c;h=59a620477d092579a3e6d692e1b405dae7927a6b;hb=53d5ac455d0616a5ee8867c986631ed34c177a42;hp=cba57b1da82c4ff0a94675fe52ac1861180a954e;hpb=7f4c8ebb15388f1ffde4bc2dd956f11522797a95;p=paraslash.git diff --git a/server.c b/server.c index cba57b1d..59a62047 100644 --- a/server.c +++ b/server.c @@ -18,7 +18,7 @@ * - Buffer trees: \ref buffer_tree.h, * - Sideband API: \ref sideband.h, * - Crypto: \ref crypt.h, \ref crypt_backend.h, - * - Error subsystem: \ref error.h, \ref error2.c, + * - Error subsystem: \ref error.h, * - Inter process communication: \ref ipc.h, * - Forward error correction: \ref fec.h, * - Daemons: \ref daemon.h, @@ -65,17 +65,17 @@ #include "ggo.h" #include "version.h" -__printf_2_3 void (*para_log)(int, const char*, ...) = daemon_log; +/** Array of error strings. */ +DEFINE_PARA_ERRLIST; -/** Define the array of error lists needed by para_server. */ -INIT_SERVER_ERRLISTS; +__printf_2_3 void (*para_log)(int, const char*, ...) = daemon_log; /** Shut down non-authorized connections after that many seconds. */ #define ALARM_TIMEOUT 10 /** * Pointer to shared memory area for communication between para_server - * and its children. Exported to vss.c. command.c and to afs. + * and its children. Exported to vss.c, command.c and to afs. */ struct misc_meta_data *mmd; @@ -207,8 +207,12 @@ void parse_config_or_die(int override) daemon_open_log_or_die(); } - daemon_init_colors_or_die(conf.color_arg, color_arg_auto, color_arg_no, - conf.logfile_given, conf.log_color_arg, conf.log_color_given); + if (daemon_init_colors_or_die(conf.color_arg, color_arg_auto, color_arg_no, + conf.logfile_given)) { + int i; + for (i = 0; i < conf.log_color_given; i++) + daemon_set_log_color_or_die(conf.log_color_arg[i]); + } daemon_set_flag(DF_LOG_PID); daemon_set_flag(DF_LOG_LL); daemon_set_flag(DF_LOG_TIME); @@ -463,6 +467,7 @@ static void server_init(int argc, char **argv) version_handle_flag("server", conf.version_given); if (conf.help_given || conf.detailed_help_given) print_help_and_die(); + daemon_set_priority(conf.priority_arg); daemon_drop_privileges_or_die(conf.user_arg, conf.group_arg); /* parse config file, open log and set defaults */ parse_config_or_die(0);