From: Remi Gacogne Date: Thu, 17 May 2018 16:04:32 +0000 (+0200) Subject: calidns: Don't issue socket buffer or SCHED_FIFO warnings in quiet mode X-Git-Tag: dnsdist-1.3.1~88^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=325e59e772bd1e216aee6c9d5e933b8a5273a339;p=pdns calidns: Don't issue socket buffer or SCHED_FIFO warnings in quiet mode --- diff --git a/pdns/calidns.cc b/pdns/calidns.cc index 503e932de..64323c484 100644 --- a/pdns/calidns.cc +++ b/pdns/calidns.cc @@ -47,11 +47,13 @@ using std::unique_ptr; StatBag S; -std::atomic g_recvcounter, g_recvbytes; -volatile bool g_done; +static std::atomic g_recvcounter, g_recvbytes; +static volatile bool g_done; namespace po = boost::program_options; -po::variables_map g_vm; +static po::variables_map g_vm; + +static bool g_quiet; static void* recvThread(const vector* sockets) { @@ -106,12 +108,17 @@ static void setSocketBuffer(int fd, int optname, uint32_t size) socklen_t len=sizeof(psize); if(!getsockopt(fd, SOL_SOCKET, optname, (char*)&psize, &len) && psize > size) { - cerr<<"Not decreasing socket buffer size from "<(); if (hitrate > 100 || hitrate < 0) { @@ -305,7 +312,7 @@ try return EXIT_FAILURE; } - if (!beQuiet) { + if (!g_quiet) { cout<<"Adding ECS option to outgoing queries with random addresses from the "<()); @@ -370,7 +379,7 @@ try unknown.emplace_back(std::make_shared>(packet)); } random_shuffle(unknown.begin(), unknown.end()); - if (!beQuiet) { + if (!g_quiet) { cout<<"Generated "< 0.0 && perc < minimumSuccessRate) { - if (beQuiet) { + if (g_quiet) { cout<