From 77857a7236758ecc7181c9bf81ca19116be94877 Mon Sep 17 00:00:00 2001 From: Jason Dellaluce Date: Mon, 10 Oct 2022 11:53:37 +0000 Subject: [PATCH] fix(userspace/falco): solve warning Signed-off-by: Jason Dellaluce --- userspace/falco/app_actions/create_signal_handlers.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/userspace/falco/app_actions/create_signal_handlers.cpp b/userspace/falco/app_actions/create_signal_handlers.cpp index 1d318b87..08ae48a9 100644 --- a/userspace/falco/app_actions/create_signal_handlers.cpp +++ b/userspace/falco/app_actions/create_signal_handlers.cpp @@ -75,7 +75,7 @@ application::run_result application::create_signal_handlers() falco::app::g_terminate.store(APP_SIGNAL_NOT_SET, std::memory_order_seq_cst); falco::app::g_restart.store(APP_SIGNAL_NOT_SET, std::memory_order_seq_cst); falco::app::g_reopen_outputs.store(APP_SIGNAL_NOT_SET, std::memory_order_seq_cst); - + if (!g_terminate.is_lock_free() || !g_restart.is_lock_free() || !g_reopen_outputs.is_lock_free()) @@ -83,12 +83,15 @@ application::run_result application::create_signal_handlers() falco_logger::log(LOG_WARNING, "Bundled atomics implementation is not lock-free, signal handlers may be unstable\n"); } - // we use the if just to make sure we return at the first failed statement run_result ret; if(! create_handler(SIGINT, ::terminate_signal_handler, ret) || ! create_handler(SIGTERM, ::terminate_signal_handler, ret) || ! create_handler(SIGUSR1, ::reopen_outputs_signal_handler, ret) || - ! create_handler(SIGHUP, ::restart_signal_handler, ret)); + ! create_handler(SIGHUP, ::restart_signal_handler, ret)) + { + // we use the if just to make sure we return at the first failed statement + } + return ret; }