From: Bert Hubert Date: Sun, 6 Feb 2005 11:47:46 +0000 (+0000) Subject: improve error reporting when user passes a non-numerical logging-facility X-Git-Tag: pdns-2.9.18~88 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c98cbd148adeaabb9e3e29cffb728b85af45530d;p=pdns improve error reporting when user passes a non-numerical logging-facility git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@292 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/receiver.cc b/pdns/receiver.cc index 0c62a0666..7c5a2c7b4 100644 --- a/pdns/receiver.cc +++ b/pdns/receiver.cc @@ -1,6 +1,6 @@ /* PowerDNS Versatile Database Driven Nameserver - Copyright (C) 2003 PowerDNS.COM BV + Copyright (C) 2005 PowerDNS.COM BV This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -417,7 +417,10 @@ int main(int argc, char **argv) arg().laxParse(argc,argv); // reparse so the commandline still wins if(!arg()["logging-facility"].empty()) { + int facility=arg().asNum("logging-facility"); + if(!isdigit(arg()["logging-facility"][0])) + facility=-1; switch(facility) { case 0: theL().setFacility(LOG_LOCAL0); @@ -444,7 +447,7 @@ int main(int argc, char **argv) theL().setFacility(LOG_LOCAL7); break; default: - L<