From: Chris Hofstaedtler Date: Tue, 29 May 2018 22:13:23 +0000 (+0200) Subject: Merge UNIX_declareArguments into declareArguments X-Git-Tag: dnsdist-1.3.3~187^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=709cbf1621257ee15a043bd245fd1183b3dd7e8c;p=thirdparty%2Fpdns.git Merge UNIX_declareArguments into declareArguments --- diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index e591174c84..786a212a72 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -62,6 +62,14 @@ ArgvMap &arg() void declareArguments() { + ::arg().set("config-dir","Location of configuration directory (pdns.conf)")=SYSCONFDIR; + ::arg().set("config-name","Name of this virtual configuration - will rename the binary image")=""; + ::arg().set("socket-dir",string("Where the controlsocket will live, ")+LOCALSTATEDIR+" when unset and not chrooted" )=""; + ::arg().set("module-dir","Default directory for modules")=PKGLIBDIR; + ::arg().set("chroot","If set, chroot to this directory for more security")=""; + ::arg().set("logging-facility","Log under a specific facility")=""; + ::arg().set("daemon","Operate as a daemon")="no"; + ::arg().set("local-port","The port on which we listen")="53"; ::arg().setSwitch("dnsupdate","Enable/Disable DNS update (RFC2136) support. Default is no.")="no"; ::arg().setSwitch("write-pid","Write a PID file")="yes"; diff --git a/pdns/receiver.cc b/pdns/receiver.cc index d62e0f1df6..9b4749c6c0 100644 --- a/pdns/receiver.cc +++ b/pdns/receiver.cc @@ -350,17 +350,6 @@ static int guardian(int argc, char **argv) } } -static void UNIX_declareArguments() -{ - ::arg().set("config-dir","Location of configuration directory (pdns.conf)")=SYSCONFDIR; - ::arg().set("config-name","Name of this virtual configuration - will rename the binary image")=""; - ::arg().set("socket-dir",string("Where the controlsocket will live, ")+LOCALSTATEDIR+" when unset and not chrooted" )=""; - ::arg().set("module-dir","Default directory for modules")=PKGLIBDIR; - ::arg().set("chroot","If set, chroot to this directory for more security")=""; - ::arg().set("logging-facility","Log under a specific facility")=""; - ::arg().set("daemon","Operate as a daemon")="no"; -} - #ifdef __GLIBC__ #include static void tbhandler(int num) @@ -405,7 +394,6 @@ int main(int argc, char **argv) g_log.toConsole(Logger::Warning); try { declareArguments(); - UNIX_declareArguments(); ::arg().laxParse(argc,argv); // do a lax parse