From 6584fef711bb6c22686b3bf94d81aee449f849ec Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Sun, 15 Aug 2021 22:36:18 +0200 Subject: [PATCH] AP_HAL_SITL: catch more signal for correct exit SIGINT is for ctrl-c SIGHUP and SIGQUIT are use within term. If the term close before SITL, it will trigger one of those and then exit cleanly anyway --- libraries/AP_HAL_SITL/HAL_SITL_Class.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/AP_HAL_SITL/HAL_SITL_Class.cpp b/libraries/AP_HAL_SITL/HAL_SITL_Class.cpp index bbe066c83e..8c75ed2735 100644 --- a/libraries/AP_HAL_SITL/HAL_SITL_Class.cpp +++ b/libraries/AP_HAL_SITL/HAL_SITL_Class.cpp @@ -170,6 +170,12 @@ void HAL_SITL::setup_signal_handlers() const sa.sa_flags = SA_NOCLDSTOP; sa.sa_handler = HAL_SITL::exit_signal_handler; sigaction(SIGTERM, &sa, NULL); +#if defined(HAL_COVERAGE_BUILD) && HAL_COVERAGE_BUILD == 1 + sigaction(SIGINT, &sa, NULL); + sigaction(SIGHUP, &sa, NULL); + sigaction(SIGQUIT, &sa, NULL); +#endif + } /*