From: Bert Hubert Date: Tue, 9 Apr 2013 15:09:32 +0000 (+0000) Subject: if we failed to make a new UDP socket, we'd report a confusing error about it X-Git-Tag: rec-3.5~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=36855b5305d8dce0ffa7c9f1e00ada1c38cadc12;p=thirdparty%2Fpdns.git if we failed to make a new UDP socket, we'd report a confusing error about it git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@3153 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 806f6cb8f6..b27ba324b1 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -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(family)+"): "+stringerror()); + + Utility::setCloseOnExec(ret); - int tries=10; while(--tries) { uint16_t port;