From: Andrei Pavel Date: Thu, 30 Jun 2022 14:00:47 +0000 (+0300) Subject: [#2432] solve warning: unused variable ‘err’ X-Git-Tag: Kea-2.2.0~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=79bf0c63fc71d551e1b267ffee0d03146bad4f10;p=thirdparty%2Fkea.git [#2432] solve warning: unused variable ‘err’ --- diff --git a/src/lib/asiolink/openssl_tls.cc b/src/lib/asiolink/openssl_tls.cc index 57640e0859..270d96a6e3 100644 --- a/src/lib/asiolink/openssl_tls.cc +++ b/src/lib/asiolink/openssl_tls.cc @@ -114,7 +114,6 @@ TlsContext::loadKeyFile(const std::string& key_file) { std::string TlsContext::getErrMsg(error_code ec) { - unsigned long err = static_cast(ec.value()); std::string msg = ec.message(); #ifdef ERR_SYSTEM_ERROR // The SSL category message() method uses ERR_reason_error_string() @@ -123,6 +122,7 @@ TlsContext::getErrMsg(error_code ec) { // This code recovers the user-friendly message from the error code // value i.e. the OpenSSL error. Layout of OpenSSL errors is detailed // in the OpenSSL err.h header. + unsigned long err = static_cast(ec.value()); if ((msg == "asio.ssl error") && (ERR_SYSTEM_ERROR(err))) { char buf[1024]; #ifndef __USE_GNU