daemon: Make daemon_init_colors_or_die() independent of gengetopt.
[paraslash.git] / server.c
index 71a9ec5..088cc8b 100644 (file)
--- a/server.c
+++ b/server.c
@@ -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);