From 3db4ea30a3153b56a6c4248a3d0e2f9612f1919d Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Tue, 15 Jul 2025 11:06:11 -0500 Subject: [PATCH] Re-add Linux signal handler that was lost when rebasing Windows service main.cpp rework --- startup/startup.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/startup/startup.cpp b/startup/startup.cpp index 1002a3cd..f01137a6 100644 --- a/startup/startup.cpp +++ b/startup/startup.cpp @@ -20,6 +20,23 @@ #include "macutils.h" #endif +#ifdef __linux__ +#include +#endif + +/******************************************************************************************\ +* * +* Linux signal handler * +* * +\******************************************************************************************/ +#ifdef __linux__ +void sigHandler(int s) +{ + std::signal(s, SIG_DFL); + qApp->quit(); +} +#endif + /******************************************************************************************\ * * * startup * @@ -105,6 +122,12 @@ int startup(int argc, char* argv[], unsigned int ret_flags) } LOG_TRACE("[main] Ready to exec() the dialog"); + +#ifdef __linux__ + std::signal(SIGINT, sigHandler); + std::signal(SIGTERM, sigHandler); +#endif + exitval = a.exec(); } else