]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
if we failed to make a new UDP socket, we'd report a confusing error about it
authorBert Hubert <bert.hubert@netherlabs.nl>
Tue, 9 Apr 2013 15:09:32 +0000 (15:09 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Tue, 9 Apr 2013 15:09:32 +0000 (15:09 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@3153 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/pdns_recursor.cc

index 806f6cb8f688b60f53232f2ca37a7aee4dde90b5..b27ba324b1b5757c5072b7fe8020e3152c4207cd 100644 (file)
@@ -324,15 +324,15 @@ public:
   static int makeClientSocket(int family)
   {
     int ret=(int)socket(family, SOCK_DGRAM, 0);
-    Utility::setCloseOnExec(ret);
 
     if(ret < 0 && errno==EMFILE) // this is not a catastrophic error
       return ret;
     
     if(ret<0) 
-      throw AhuException("Making a socket for resolver: "+stringerror());
+      throw AhuException("Making a socket for resolver (family =)"+lexical_cast<string>(family)+"): "+stringerror());
+
+    Utility::setCloseOnExec(ret);
 
-    
     int tries=10;
     while(--tries) {
       uint16_t port;