From: Otto Moerbeek Date: Fri, 28 Jun 2019 14:58:20 +0000 (+0200) Subject: Remaining strerror(errno) -> stringerror() conversions X-Git-Tag: dnsdist-1.4.0-rc3~39^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0436036756148ab40d9c51f5826243d3db9afb03;p=thirdparty%2Fpdns.git Remaining strerror(errno) -> stringerror() conversions --- diff --git a/pdns/dnsdist-carbon.cc b/pdns/dnsdist-carbon.cc index e3fc46fa17..1d5f468bce 100644 --- a/pdns/dnsdist-carbon.cc +++ b/pdns/dnsdist-carbon.cc @@ -210,7 +210,7 @@ try int ret = waitForRWData(s.getHandle(), false, 1 , 0); if(ret <= 0 ) { - vinfolog("Unable to write data to carbon server on %s: %s", server.toStringWithPort(), (ret<0 ? strerror(errno) : "Timeout")); + vinfolog("Unable to write data to carbon server on %s: %s", server.toStringWithPort(), (ret<0 ? stringerror() : "Timeout")); continue; } s.setBlocking(); diff --git a/pdns/dnsdist-tcp.cc b/pdns/dnsdist-tcp.cc index 9021d4f7ad..60e47b261e 100644 --- a/pdns/dnsdist-tcp.cc +++ b/pdns/dnsdist-tcp.cc @@ -269,7 +269,7 @@ void TCPClientCollection::addTCPClientThread() } else { if (pipe(pipefds) < 0) { - errlog("Error creating the TCP thread communication pipe: %s", strerror(errno)); + errlog("Error creating the TCP thread communication pipe: %s", stringerror()); return; } diff --git a/pdns/iputils.cc b/pdns/iputils.cc index 2010a6e5f9..76dc1bf960 100644 --- a/pdns/iputils.cc +++ b/pdns/iputils.cc @@ -41,7 +41,7 @@ int SSocket(int family, int type, int flags) { int ret = socket(family, type, flags); if(ret < 0) - RuntimeError(boost::format("creating socket of type %d: %s") % family % strerror(errno)); + RuntimeError(boost::format("creating socket of type %d: %s") % family % stringerror()); return ret; } @@ -116,7 +116,7 @@ int SAccept(int sockfd, ComboAddress& remote) int ret = accept(sockfd, (struct sockaddr*)&remote, &remlen); if(ret < 0) - RuntimeError(boost::format("accepting new connection on socket: %s") % strerror(errno)); + RuntimeError(boost::format("accepting new connection on socket: %s") % stringerror()); return ret; } @@ -124,7 +124,7 @@ int SListen(int sockfd, int limit) { int ret = listen(sockfd, limit); if(ret < 0) - RuntimeError(boost::format("setting socket to listen: %s") % strerror(errno)); + RuntimeError(boost::format("setting socket to listen: %s") % stringerror()); return ret; } @@ -132,7 +132,7 @@ int SSetsockopt(int sockfd, int level, int opname, int value) { int ret = setsockopt(sockfd, level, opname, &value, sizeof(value)); if(ret < 0) - RuntimeError(boost::format("setsockopt for level %d and opname %d to %d failed: %s") % level % opname % value % strerror(errno)); + RuntimeError(boost::format("setsockopt for level %d and opname %d to %d failed: %s") % level % opname % value % stringerror()); return ret; } diff --git a/pdns/ixfrdist.cc b/pdns/ixfrdist.cc index d23d554cbe..c572c33596 100644 --- a/pdns/ixfrdist.cc +++ b/pdns/ixfrdist.cc @@ -308,7 +308,7 @@ void updateThread(const string& workdir, const uint16_t& keep, const uint16_t& a g_log<(sizeof tmp))<0) - throw PDNSException(string("Setsockopt failed: ")+strerror(errno)); + throw PDNSException(string("Setsockopt failed: ")+stringerror()); return true; } @@ -1111,7 +1111,7 @@ bool setReceiveSocketErrors(int sock, int af) ret = setsockopt(sock, IPPROTO_IPV6, IPV6_RECVERR, &tmp, sizeof(tmp)); } if (ret < 0) { - throw PDNSException(string("Setsockopt failed: ") + strerror(errno)); + throw PDNSException(string("Setsockopt failed: ") + stringerror()); } #endif return true; diff --git a/pdns/nameserver.cc b/pdns/nameserver.cc index 5581239171..e45fa5cb0c 100644 --- a/pdns/nameserver.cc +++ b/pdns/nameserver.cc @@ -103,8 +103,8 @@ void UDPNameserver::bindIPv4() s=socket(AF_INET,SOCK_DGRAM,0); if(s<0) { - g_log< "<getMaxReplyLen()<<". Question was for "<qdomain<<"|"<qtype.getName()<getSocket(), &msgh, 0) < 0) - g_log<sendEvent(pident, &empty); - // cerr<<"Had some kind of error: "<generation + 1; diff --git a/pdns/receiver.cc b/pdns/receiver.cc index e6686787b3..d7b47f27ef 100644 --- a/pdns/receiver.cc +++ b/pdns/receiver.cc @@ -149,7 +149,7 @@ static void writePid(void) if(of) of<