]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2432] solve warning: unused variable ‘err’
authorAndrei Pavel <andrei@isc.org>
Thu, 30 Jun 2022 14:00:47 +0000 (17:00 +0300)
committerTomek Mrugalski <tomek@isc.org>
Fri, 8 Jul 2022 14:06:05 +0000 (16:06 +0200)
src/lib/asiolink/openssl_tls.cc

index 57640e0859b42e3c84239f94cbe58cb63c933fba..270d96a6e3c71b452dae670dc1dfaa444105ea1c 100644 (file)
@@ -114,7 +114,6 @@ TlsContext::loadKeyFile(const std::string& key_file) {
 
 std::string
 TlsContext::getErrMsg(error_code ec) {
-    unsigned long err = static_cast<unsigned long>(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<unsigned long>(ec.value());
     if ((msg == "asio.ssl error") && (ERR_SYSTEM_ERROR(err))) {
         char buf[1024];
 #ifndef __USE_GNU