diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-04-13 19:24:05 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-04-13 19:24:05 +0000 |
commit | b5bdc71d2c2041e9db7c461f5e15897b7e5c4be2 (patch) | |
tree | 7ab68fa9b8acbe46badb7c5081c02d9ca73e32d3 /src/sig_handlers.c | |
parent | 860f8bda714da8724777e47829e751585b4ca288 (diff) | |
download | mpd-b5bdc71d2c2041e9db7c461f5e15897b7e5c4be2.tar.gz mpd-b5bdc71d2c2041e9db7c461f5e15897b7e5c4be2.tar.xz mpd-b5bdc71d2c2041e9db7c461f5e15897b7e5c4be2.zip |
have update process ignore signals when writing db
git-svn-id: https://svn.musicpd.org/mpd/trunk@735 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/sig_handlers.c | 14 |
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; |