From a34586cffe40d3cd653bff6ef30e64ddf982409d Mon Sep 17 00:00:00 2001 From: Fred Morcos Date: Wed, 3 Aug 2022 13:34:01 +0200 Subject: [PATCH] Cleanup --- pdns/recursordist/rec-main.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index c248fcfc8b..40f4af10d4 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -2955,16 +2955,15 @@ static RecursorControlChannel::Answer* doReloadLuaScript() g_log << Logger::Info << RecThreadInfo::id() << " Unloaded current lua script" << endl; return new RecursorControlChannel::Answer{0, string("unloaded\n")}; } - else { - t_pdl = std::make_shared(); - try { - t_pdl->loadFile(fname); - } - catch (std::runtime_error& ex) { - string msg = std::to_string(RecThreadInfo::id()) + " Retaining current script, could not read '" + fname + "': " + ex.what(); - g_log << Logger::Error << msg << endl; - return new RecursorControlChannel::Answer{1, msg + "\n"}; - } + + t_pdl = std::make_shared(); + try { + t_pdl->loadFile(fname); + } + catch (std::runtime_error& ex) { + string msg = std::to_string(RecThreadInfo::id()) + " Retaining current script, could not read '" + fname + "': " + ex.what(); + g_log << Logger::Error << msg << endl; + return new RecursorControlChannel::Answer{1, msg + "\n"}; } } catch (std::exception& e) { -- 2.47.2