daemon: Let all command line options override global options from the config.
[collectd.git] / src / daemon / collectd.c
index a72ff35..ce4922d 100644 (file)
@@ -54,7 +54,6 @@
  */
 char hostname_g[DATA_MAX_NAME_LEN];
 cdtime_t interval_g;
-int  pidfile_from_cli = 0;
 int  timeout_g;
 #if HAVE_LIBKSTAT
 kstat_ctl_t *kc;
@@ -551,15 +550,14 @@ int main (int argc, char **argv)
                                break;
                        case 'T':
                                test_readall = 1;
-                               global_option_set ("ReadThreads", "-1");
+                               global_option_set ("ReadThreads", "-1", 1);
 #if COLLECT_DAEMON
                                daemonize = 0;
 #endif /* COLLECT_DAEMON */
                                break;
 #if COLLECT_DAEMON
                        case 'P':
-                               global_option_set ("PIDFile", optarg);
-                               pidfile_from_cli = 1;
+                               global_option_set ("PIDFile", optarg, 1);
                                break;
                        case 'f':
                                daemonize = 0;