From f464195047773f9b90ee7a34db56408088f31fac Mon Sep 17 00:00:00 2001 From: JesusPoderoso Date: Tue, 23 Jan 2024 16:10:23 +0100 Subject: [PATCH 1/5] Refs #19587: Include SIGHUP handler Signed-off-by: JesusPoderoso --- tools/fds/server.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/fds/server.cpp b/tools/fds/server.cpp index e170ac5dc66..8dbfd5777c7 100644 --- a/tools/fds/server.cpp +++ b/tools/fds/server.cpp @@ -561,6 +561,9 @@ int fastdds_discovery_server( // Handle signal SIGINT for every thread signal(SIGINT, sigint_handler); signal(SIGTERM, sigint_handler); +#ifndef _WIN32 + signal(SIGHUP, sigint_handler); +#endif // ifndef _WIN32 bool has_security = false; if (guid_prefix != pServer->guid().guidPrefix) From 0a4310ad64de6ec07bee1eca7c8e8f0dafdfc4c6 Mon Sep 17 00:00:00 2001 From: JesusPoderoso Date: Wed, 24 Jan 2024 23:39:36 +0100 Subject: [PATCH 2/5] Refs #19587: Handle more signals Signed-off-by: JesusPoderoso --- tools/fds/server.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/fds/server.cpp b/tools/fds/server.cpp index 8dbfd5777c7..70bb7dcab22 100644 --- a/tools/fds/server.cpp +++ b/tools/fds/server.cpp @@ -561,6 +561,13 @@ int fastdds_discovery_server( // Handle signal SIGINT for every thread signal(SIGINT, sigint_handler); signal(SIGTERM, sigint_handler); + signal(SIGQUIT, sigint_handler); + signal(SIGILL, sigint_handler); + signal(SIGABRT, sigint_handler); + signal(SIGBUS, sigint_handler); + signal(SIGFPE, sigint_handler); + signal(SIGSEGV, sigint_handler); + signal(SIGPIPE, sigint_handler); #ifndef _WIN32 signal(SIGHUP, sigint_handler); #endif // ifndef _WIN32 From c4930c06e0d0511f0b6846e6fb1a813eef760bf5 Mon Sep 17 00:00:00 2001 From: JesusPoderoso Date: Thu, 25 Jan 2024 11:22:45 +0100 Subject: [PATCH 3/5] Refs #19587: Move proper signals to 'linux only' case Signed-off-by: JesusPoderoso --- tools/fds/server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/fds/server.cpp b/tools/fds/server.cpp index 70bb7dcab22..29df30894a7 100644 --- a/tools/fds/server.cpp +++ b/tools/fds/server.cpp @@ -566,9 +566,9 @@ int fastdds_discovery_server( signal(SIGABRT, sigint_handler); signal(SIGBUS, sigint_handler); signal(SIGFPE, sigint_handler); +#ifndef _WIN32 signal(SIGSEGV, sigint_handler); signal(SIGPIPE, sigint_handler); -#ifndef _WIN32 signal(SIGHUP, sigint_handler); #endif // ifndef _WIN32 From bc4a6f48d1875d12f0e2431139d4e17cde1ee896 Mon Sep 17 00:00:00 2001 From: JesusPoderoso Date: Thu, 25 Jan 2024 11:39:16 +0100 Subject: [PATCH 4/5] Refs #19587: Apply Miguel suggestion Signed-off-by: JesusPoderoso --- tools/fds/server.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/fds/server.cpp b/tools/fds/server.cpp index 29df30894a7..1e484a1b646 100644 --- a/tools/fds/server.cpp +++ b/tools/fds/server.cpp @@ -562,13 +562,7 @@ int fastdds_discovery_server( signal(SIGINT, sigint_handler); signal(SIGTERM, sigint_handler); signal(SIGQUIT, sigint_handler); - signal(SIGILL, sigint_handler); - signal(SIGABRT, sigint_handler); - signal(SIGBUS, sigint_handler); - signal(SIGFPE, sigint_handler); #ifndef _WIN32 - signal(SIGSEGV, sigint_handler); - signal(SIGPIPE, sigint_handler); signal(SIGHUP, sigint_handler); #endif // ifndef _WIN32 From 91792ae57e0579228a805185b0328c3e18521576 Mon Sep 17 00:00:00 2001 From: JesusPoderoso Date: Fri, 26 Jan 2024 13:56:07 +0100 Subject: [PATCH 5/5] Refs #19587: Fix Windows build Signed-off-by: JesusPoderoso --- tools/fds/server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/fds/server.cpp b/tools/fds/server.cpp index 1e484a1b646..29cc0f5e172 100644 --- a/tools/fds/server.cpp +++ b/tools/fds/server.cpp @@ -561,8 +561,8 @@ int fastdds_discovery_server( // Handle signal SIGINT for every thread signal(SIGINT, sigint_handler); signal(SIGTERM, sigint_handler); - signal(SIGQUIT, sigint_handler); #ifndef _WIN32 + signal(SIGQUIT, sigint_handler); signal(SIGHUP, sigint_handler); #endif // ifndef _WIN32