mirror of https://github.com/Icinga/icinga2.git
Reset all signal handlers of child processes
... not to disturb check plugins. refs #6912
This commit is contained in:
parent
6c03598678
commit
d48b369554
|
@ -19,6 +19,7 @@
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
# include <execvpe.h>
|
# include <execvpe.h>
|
||||||
# include <poll.h>
|
# include <poll.h>
|
||||||
|
# include <signal.h>
|
||||||
# include <string.h>
|
# include <string.h>
|
||||||
|
|
||||||
# ifndef __APPLE__
|
# ifndef __APPLE__
|
||||||
|
@ -170,6 +171,17 @@ static Value ProcessSpawnImpl(struct msghdr *msgh, const Dictionary::Ptr& reques
|
||||||
}
|
}
|
||||||
#endif /* HAVE_NICE */
|
#endif /* HAVE_NICE */
|
||||||
|
|
||||||
|
{
|
||||||
|
struct sigaction sa;
|
||||||
|
memset(&sa, 0, sizeof(sa));
|
||||||
|
|
||||||
|
sa.sa_handler = SIG_DFL;
|
||||||
|
|
||||||
|
for (int sig = 1; sig <= 31; ++sig) {
|
||||||
|
(void)sigaction(sig, &sa, nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sigset_t mask;
|
sigset_t mask;
|
||||||
sigemptyset(&mask);
|
sigemptyset(&mask);
|
||||||
sigprocmask(SIG_SETMASK, &mask, nullptr);
|
sigprocmask(SIG_SETMASK, &mask, nullptr);
|
||||||
|
|
Loading…
Reference in New Issue