From: bert hubert Date: Thu, 26 Nov 2015 14:23:57 +0000 (+0100) Subject: EMFILE was (out of filedescriptors, too many open files) was reported as an error... X-Git-Tag: dnsdist-1.0.0-alpha1~190^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ee280cfa4d6aaed243d0f994b201c9ac75925f0;p=thirdparty%2Fpdns.git EMFILE was (out of filedescriptors, too many open files) was reported as an error that could be blamed on the remote nameserver instead of on the OS, causing throttle actions. --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 886a959cc4..4538e398d0 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -353,12 +353,12 @@ public: typedef set socks_t; socks_t d_socks; - // returning -1 means: temporary OS error (ie, out of files), -2 means OS error + // returning -2 means: temporary OS error (ie, out of files), -1 means error related to remote int getSocket(const ComboAddress& toaddr, int* fd) { *fd=makeClientSocket(toaddr.sin4.sin_family); if(*fd < 0) // temporary error - receive exception otherwise - return -1; + return -2; if(connect(*fd, (struct sockaddr*)(&toaddr), toaddr.getSocklen()) < 0) { int err = errno;