From: Otto Date: Wed, 15 Dec 2021 12:40:20 +0000 (+0100) Subject: auth: save errno value as close(2) might clobber it X-Git-Tag: auth-4.7.0-alpha1~121^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11101%2Fhead;p=thirdparty%2Fpdns.git auth: save errno value as close(2) might clobber it --- diff --git a/pdns/nameserver.cc b/pdns/nameserver.cc index ce07abdc7d..183033dd6e 100644 --- a/pdns/nameserver.cc +++ b/pdns/nameserver.cc @@ -150,13 +150,13 @@ void UDPNameserver::bindAddresses() g_localaddresses.push_back(locala); if(::bind(s, (sockaddr*)&locala, locala.getSocklen()) < 0) { - string binderror = stringerror(); + int err = errno; close(s); - if( errno == EADDRNOTAVAIL && ! ::arg().mustDo("local-address-nonexist-fail") ) { + if (err == EADDRNOTAVAIL && !::arg().mustDo("local-address-nonexist-fail")) { g_log<