Make sure that "PIDFile" option cannot be set when command-line option "-P" was used...
[collectd.git] / src / configfile.c
index 0e54f26..c5d3e36 100644 (file)
@@ -891,6 +891,13 @@ int global_option_set (const char *option, const char *value)
        if (i >= cf_global_options_num)
                return (-1);
 
+       if (strcasecmp (option, "PIDFile") == 0 && pidfile_from_cli == 1)
+       {
+               DEBUG ("Configfile: Ignoring `PIDFILE' option because "
+                       "command-line option `-P' take precedence.");
+               return (0);
+       }
+
        sfree (cf_global_options[i].value);
 
        if (value != NULL)