From 2f9f6cabd65eb0cd0adb5c2101f088a52cc95629 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 15 Feb 2024 09:06:58 +0100 Subject: [PATCH] Include variety of terminate process signals handler in discovery server (#4278) (#4332) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refs #19587: Include SIGHUP handler Signed-off-by: JesusPoderoso * Refs #19587: Handle more signals Signed-off-by: JesusPoderoso * Refs #19587: Move proper signals to 'linux only' case Signed-off-by: JesusPoderoso * Refs #19587: Apply Miguel suggestion Signed-off-by: JesusPoderoso * Refs #19587: Fix Windows build Signed-off-by: JesusPoderoso --------- Signed-off-by: JesusPoderoso (cherry picked from commit 6eb1170f7bb946fce1b2674bf16662a468871a3b) Co-authored-by: Jesús Poderoso <120394830+JesusPoderoso@users.noreply.github.com> --- tools/fds/server.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/fds/server.cpp b/tools/fds/server.cpp index e170ac5dc66..29cc0f5e172 100644 --- a/tools/fds/server.cpp +++ b/tools/fds/server.cpp @@ -561,6 +561,10 @@ int fastdds_discovery_server( // Handle signal SIGINT for every thread signal(SIGINT, sigint_handler); signal(SIGTERM, sigint_handler); +#ifndef _WIN32 + signal(SIGQUIT, sigint_handler); + signal(SIGHUP, sigint_handler); +#endif // ifndef _WIN32 bool has_security = false; if (guid_prefix != pServer->guid().guidPrefix)