From e3231d8a5c4c93aff5063dd3706c5a3cd88c35f8 Mon Sep 17 00:00:00 2001 From: Otto Date: Wed, 15 Dec 2021 13:40:20 +0100 Subject: [PATCH] auth: save errno value as close(2) might clobber it --- pdns/nameserver.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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<