From: Florian Forster Date: Mon, 17 Aug 2020 15:16:11 +0000 (+0200) Subject: daemon: Accept the same command line arguments, even when compiled with --disable... X-Git-Tag: collectd-5.12.0~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=61b4f3c4026553ff4ee3781ef652cd48a4ba429e;p=thirdparty%2Fcollectd.git daemon: Accept the same command line arguments, even when compiled with --disable-daemon. --- diff --git a/src/daemon/collectd.c b/src/daemon/collectd.c index 16c190323..e4fb50b24 100644 --- a/src/daemon/collectd.c +++ b/src/daemon/collectd.c @@ -307,13 +307,7 @@ static int do_shutdown(void) { static void read_cmdline(int argc, char **argv, struct cmdline_config *config) { /* read options */ while (1) { - int c = getopt(argc, argv, - "BhtTfC:" -#if COLLECT_DAEMON - "P:" -#endif - ); - + int c = getopt(argc, argv, "BhtTfC:P:"); if (c == -1) break; @@ -334,17 +328,16 @@ static void read_cmdline(int argc, char **argv, struct cmdline_config *config) { config->daemonize = false; #endif /* COLLECT_DAEMON */ break; -#if COLLECT_DAEMON case 'P': +#if COLLECT_DAEMON global_option_set("PIDFile", optarg, 1); +#endif /* COLLECT_DAEMON */ break; case 'f': config->daemonize = false; break; -#else case 'f': break; -#endif /* COLLECT_DAEMON */ case 'h': exit_usage(0); default: