From 1aa65bd10c7b812c6320c0d4c88d640c73c36297 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Thu, 9 Sep 2021 11:10:15 +0200 Subject: [PATCH] HOTFIX: force DFT wisdom save at exit --- lib/include/srsran/common/signal_handler.h | 3 +++ lib/src/phy/dft/dft_fftw.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/include/srsran/common/signal_handler.h b/lib/include/srsran/common/signal_handler.h index 41797d65d..fefb23f02 100644 --- a/lib/include/srsran/common/signal_handler.h +++ b/lib/include/srsran/common/signal_handler.h @@ -33,6 +33,8 @@ extern "C" { static srslog::sink* log_sink = nullptr; static std::atomic running = {true}; +void srsran_dft_exit(); + static void srsran_signal_handler(int signal) { switch (signal) { @@ -43,6 +45,7 @@ static void srsran_signal_handler(int signal) if (log_sink) { log_sink->flush(); } + srsran_dft_exit(); raise(SIGKILL); default: // all other registered signals try to stop the app gracefully diff --git a/lib/src/phy/dft/dft_fftw.c b/lib/src/phy/dft/dft_fftw.c index 8b4e4adef..c6e1a6f4e 100644 --- a/lib/src/phy/dft/dft_fftw.c +++ b/lib/src/phy/dft/dft_fftw.c @@ -71,7 +71,7 @@ __attribute__((constructor)) static void srsran_dft_load() } // This function is called in the ending of any executable where it is linked -__attribute__((destructor)) static void srsran_dft_exit() +__attribute__((destructor)) void srsran_dft_exit() { #ifdef FFTW_WISDOM_FILE char full_path[256];