aboutsummaryrefslogtreecommitdiffstats
path: root/src/sig_handlers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sig_handlers.c')
-rw-r--r--src/sig_handlers.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sig_handlers.c b/src/sig_handlers.c
index 84ca8b78e..eb39e9719 100644
--- a/src/sig_handlers.c
+++ b/src/sig_handlers.c
@@ -83,6 +83,20 @@ void finishSigHandlers() {
signal_unhandle(SIGHUP);
}
+void ignoreSignals() {
+ struct sigaction sa;
+
+ sa.sa_flags = 0;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_handler = SIG_IGN;
+ while(sigaction(SIGPIPE,&sa,NULL)<0 && errno==EINTR);
+ while(sigaction(SIGCHLD,&sa,NULL)<0 && errno==EINTR);
+ while(sigaction(SIGUSR1,&sa,NULL)<0 && errno==EINTR);
+ while(sigaction(SIGINT,&sa,NULL)<0 && errno==EINTR);
+ while(sigaction(SIGTERM,&sa,NULL)<0 && errno==EINTR);
+ while(sigaction(SIGHUP,&sa,NULL)<0 && errno==EINTR);
+}
+
void blockSignals() {
sigset_t sset;