From 6eb1170f7bb946fce1b2674bf16662a468871a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Tue, 30 Jan 2024 15:59:47 +0100 Subject: [PATCH] Include variety of terminate proccess signals handler in discovery server (#4278) * 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 --- 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)