diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-04-13 17:08:31 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-04-13 17:08:31 +0000 |
commit | 5a50fa7147be049212274534ccfbf7ed14708070 (patch) | |
tree | 4f4f34fb6479102d7bf0d5ae8247a7bfac806aa8 /src/sig_handlers.c | |
parent | acf0e147c25d93d9434bb279ae422cb4e62c1f7e (diff) | |
download | mpd-5a50fa7147be049212274534ccfbf7ed14708070.tar.gz mpd-5a50fa7147be049212274534ccfbf7ed14708070.tar.xz mpd-5a50fa7147be049212274534ccfbf7ed14708070.zip |
block signals when writing db to ensure db isn't corrupted
git-svn-id: https://svn.musicpd.org/mpd/trunk@730 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/sig_handlers.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sig_handlers.c b/src/sig_handlers.c index 126777de6..84ca8b78e 100644 --- a/src/sig_handlers.c +++ b/src/sig_handlers.c @@ -90,6 +90,8 @@ void blockSignals() { sigaddset(&sset,SIGCHLD); sigaddset(&sset,SIGUSR1); sigaddset(&sset,SIGHUP); + sigaddset(&sset,SIGINT); + sigaddset(&sset,SIGTERM); while(sigprocmask(SIG_BLOCK,&sset,NULL)<0 && errno==EINTR); } @@ -100,5 +102,7 @@ void unblockSignals() { sigaddset(&sset,SIGCHLD); sigaddset(&sset,SIGUSR1); sigaddset(&sset,SIGHUP); + sigaddset(&sset,SIGINT); + sigaddset(&sset,SIGTERM); while(sigprocmask(SIG_UNBLOCK,&sset,NULL)<0 && errno==EINTR); } |