aboutsummaryrefslogtreecommitdiffstats
path: root/src/sig_handlers.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-04-13 16:46:11 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-04-13 16:46:11 +0000
commitacf0e147c25d93d9434bb279ae422cb4e62c1f7e (patch)
treeef923e4cec52fe1739f035d6a29f7f4ffa021c16 /src/sig_handlers.c
parent00c25b772edae62965b1615125b057f5986d18c2 (diff)
downloadmpd-acf0e147c25d93d9434bb279ae422cb4e62c1f7e.tar.gz
mpd-acf0e147c25d93d9434bb279ae422cb4e62c1f7e.tar.xz
mpd-acf0e147c25d93d9434bb279ae422cb4e62c1f7e.zip
when doing signal functions (like sigaction) make sure it wasn't interrupted by a signal (errno==EINTR)
git-svn-id: https://svn.musicpd.org/mpd/trunk@729 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/sig_handlers.c')
-rw-r--r--src/sig_handlers.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sig_handlers.c b/src/sig_handlers.c
index 9ec23df4b..126777de6 100644
--- a/src/sig_handlers.c
+++ b/src/sig_handlers.c
@@ -67,9 +67,9 @@ void initSigHandlers() {
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sa.sa_handler = SIG_IGN;
- sigaction(SIGPIPE,&sa,NULL);
+ while(sigaction(SIGPIPE,&sa,NULL)<0 && errno==EINTR);
sa.sa_handler = chldSigHandler;
- sigaction(SIGCHLD,&sa,NULL);
+ while(sigaction(SIGCHLD,&sa,NULL)<0 && errno==EINTR);
signal_handle(SIGUSR1);
signal_handle(SIGINT);
signal_handle(SIGTERM);
@@ -90,7 +90,7 @@ void blockSignals() {
sigaddset(&sset,SIGCHLD);
sigaddset(&sset,SIGUSR1);
sigaddset(&sset,SIGHUP);
- sigprocmask(SIG_BLOCK,&sset,NULL);
+ while(sigprocmask(SIG_BLOCK,&sset,NULL)<0 && errno==EINTR);
}
void unblockSignals() {
@@ -100,5 +100,5 @@ void unblockSignals() {
sigaddset(&sset,SIGCHLD);
sigaddset(&sset,SIGUSR1);
sigaddset(&sset,SIGHUP);
- sigprocmask(SIG_UNBLOCK,&sset,NULL);
+ while(sigprocmask(SIG_UNBLOCK,&sset,NULL)<0 && errno==EINTR);
}