]> granicus.if.org Git - pdns/commitdiff
Some stringerror() missed cases as spotted by chbruyand
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 12 Aug 2019 12:24:24 +0000 (14:24 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 12 Aug 2019 12:24:24 +0000 (14:24 +0200)
pdns/dnsdist-tcp.cc
pdns/nameserver.cc
pdns/pdns_recursor.cc
pdns/tcpreceiver.cc

index 259c377d3ac38510f29c5287e424f4b9280e7f1d..d4a7b635c1319e03fdef858056b2cb2c8c02a163 100644 (file)
@@ -288,7 +288,7 @@ void TCPClientCollection::addTCPClientThread()
       int err = errno;
       close(pipefds[0]);
       close(pipefds[1]);
-      errlog("Error setting the TCP thread communication pipe non-blocking: %s", strerror(err));
+      errlog("Error setting the TCP thread communication pipe non-blocking: %s", stringerror(err));
       return;
     }
 
@@ -296,7 +296,7 @@ void TCPClientCollection::addTCPClientThread()
       int err = errno;
       close(pipefds[0]);
       close(pipefds[1]);
-      errlog("Error setting the TCP thread communication pipe non-blocking: %s", strerror(err));
+      errlog("Error setting the TCP thread communication pipe non-blocking: %s", stringerror(err));
       return;
     }
   }
index c5753f804414fba54cec0c4f79b061c817c61fea..7f0785989bea62148d861ed31f04215ef220e18e 100644 (file)
@@ -103,8 +103,9 @@ void UDPNameserver::bindIPv4()
     s=socket(AF_INET,SOCK_DGRAM,0);
 
     if(s<0) {
-      g_log<<Logger::Error<<"Unable to acquire UDP socket: "+stringerror() << endl;
-      throw PDNSException("Unable to acquire a UDP socket: "+stringerror());
+      int err = errno;
+      g_log<<Logger::Error<<"Unable to acquire UDP socket: "+stringerror(err) << endl;
+      throw PDNSException("Unable to acquire a UDP socket: "+stringerror(err));
     }
   
     setCloseOnExec(s);
index 7e41abe8e107f3f340842cdc74808efe9b2615ea..d446d487e32de92c8741610a2f302404db2a21b9 100644 (file)
@@ -516,7 +516,7 @@ static void setSocketBuffer(int fd, int optname, uint32_t size)
 
   if (setsockopt(fd, SOL_SOCKET, optname, (char*)&size, sizeof(size)) < 0) {
     int err = errno;
-    g_log << Logger::Error << "Unable to raise socket buffer size to " << size << ": " << strerror(err) << endl;
+    g_log << Logger::Error << "Unable to raise socket buffer size to " << size << ": " << stringerror(err) << endl;
   }
 }
 
@@ -738,7 +738,7 @@ static void writePid(void)
   else {
     int err = errno;
     g_log << Logger::Error << "Writing pid for " << Utility::getpid() << " to " << s_pidfname << " failed: "
-          << strerror(err) << endl;
+          << stringerror(err) << endl;
   }
 }
 
index ced0b48061d205d45131e1e9b557a2c70dc55154..67f9abd2d7773b06314cb94d63ef81013731d5dc 100644 (file)
@@ -1301,7 +1301,7 @@ TCPNameserver::TCPNameserver()
         g_log<<Logger::Error<<"IPv6 Address " << *laddr << " does not exist on this server - skipping TCP bind" << endl;
         continue;
       } else {
-        g_log<<Logger::Error<<"Unable to bind to TCPv6 socket" << *laddr << ": "<<strerror(err)<<endl;
+        g_log<<Logger::Error<<"Unable to bind to TCPv6 socket" << *laddr << ": "<<stringerror(err)<<endl;
         throw PDNSException("Unable to bind to TCPv6 socket");
       }
     }