Merge pull request #9653 from Icinga/9631

Setup all signal handlers with SA_RESTART flag
This commit is contained in:
Julian Brost 2023-02-14 17:55:09 +01:00 committed by GitHub
commit 3023009804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -974,6 +974,7 @@ void Application::InstallExceptionHandlers()
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = &Application::SigAbrtHandler;
sa.sa_flags = SA_RESTART;
sigaction(SIGABRT, &sa, nullptr);
#else /* _WIN32 */
l_DefaultUnhandledExceptionFilter = SetUnhandledExceptionFilter(&Application::SEHUnhandledExceptionFilter);
@ -991,6 +992,7 @@ int Application::Run()
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = &Application::SigUsr1Handler;
sa.sa_flags = SA_RESTART;
sigaction(SIGUSR1, &sa, nullptr);
#else /* _WIN32 */
SetConsoleCtrlHandler(&Application::CtrlHandler, TRUE);