X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcollectd.c;h=4fbd5c0923193bdd95832278a84f467941bca77b;hb=8a35017c70b0fc1a3531a0b630071dedbbaa9372;hp=49998f96101b9c7d94e48d76aa92c63c7b80eff9;hpb=44e4d530c8db2e078cd73ab254d1be41a5f2812c;p=collectd.git diff --git a/src/collectd.c b/src/collectd.c index 49998f96..4fbd5c09 100644 --- a/src/collectd.c +++ b/src/collectd.c @@ -320,6 +320,7 @@ int main (int argc, char **argv) struct sigaction sigIntAction; struct sigaction sigTermAction; char *configfile = CONFIGFILE; + int test_config = 0; const char *basedir; #if COLLECT_DAEMON struct sigaction sigChldAction; @@ -332,7 +333,7 @@ int main (int argc, char **argv) { int c; - c = getopt (argc, argv, "hC:" + c = getopt (argc, argv, "htC:" #if COLLECT_DAEMON "fP:" #endif @@ -346,6 +347,9 @@ int main (int argc, char **argv) case 'C': configfile = optarg; break; + case 't': + test_config = 1; + break; #if COLLECT_DAEMON case 'P': global_option_set ("PIDFile", optarg); @@ -397,6 +401,9 @@ int main (int argc, char **argv) if (init_global_variables () != 0) return (1); + if (test_config) + return (0); + #if COLLECT_DAEMON /* * fork off child