Ignore SIGPIPE earlier in the start-up process

fixes #13567
This commit is contained in:
Gunnar Beutner 2017-01-12 10:50:04 +01:00
parent 399827c62e
commit 751ca67e0a
2 changed files with 5 additions and 4 deletions

View File

@ -138,6 +138,11 @@ void Application::InitializeBase(void)
<< boost::errinfo_api_function("WSAStartup")
<< errinfo_win32_error(WSAGetLastError()));
}
#else /* _WIN32 */
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sa, NULL);
#endif /* _WIN32 */
Loader::ExecuteDeferredInitializers();
@ -881,9 +886,6 @@ int Application::Run(void)
sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
sa.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sa, NULL);
sa.sa_handler = &Application::SigUsr1Handler;
sigaction(SIGUSR1, &sa, NULL);
#else /* _WIN32 */

View File

@ -167,7 +167,6 @@ static Value ProcessSpawnImpl(struct msghdr *msgh, const Dictionary::Ptr& reques
sigset_t mask;
sigemptyset(&mask);
sigaddset(&mask, SIGPIPE);
sigprocmask(SIG_SETMASK, &mask, NULL);
if (icinga2_execvpe(argv[0], argv, envp) < 0) {