summaryrefslogtreecommitdiff
path: root/libexec/ftpd/monitor.c
diff options
context:
space:
mode:
authorMoritz Jodeit <moritz@cvs.openbsd.org>2004-12-06 20:52:05 +0000
committerMoritz Jodeit <moritz@cvs.openbsd.org>2004-12-06 20:52:05 +0000
commit8f1352968e2e5e627da467c758f82f1fd3d49986 (patch)
tree009b32f11e51fd566763baac669ec4dd155d8912 /libexec/ftpd/monitor.c
parent2bff385110b5f53f6b9b78f6f711a5ab26f51506 (diff)
make signal blocking a lot easier.
ok millert@, henning@
Diffstat (limited to 'libexec/ftpd/monitor.c')
-rw-r--r--libexec/ftpd/monitor.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/libexec/ftpd/monitor.c b/libexec/ftpd/monitor.c
index ff9692ddf2a..2c0dd90faa5 100644
--- a/libexec/ftpd/monitor.c
+++ b/libexec/ftpd/monitor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor.c,v 1.4 2004/11/29 22:24:57 henning Exp $ */
+/* $OpenBSD: monitor.c,v 1.5 2004/12/06 20:52:04 moritz Exp $ */
/*
* Copyright (c) 2004 Moritz Jodeit <moritz@jodeit.org>
@@ -136,7 +136,7 @@ set_monitor_signals(void)
struct sigaction act;
int i;
- sigemptyset(&act.sa_mask);
+ sigfillset(&act.sa_mask);
act.sa_flags = 0;
act.sa_handler = SIG_DFL;
@@ -378,16 +378,11 @@ handle_cmds(void)
void
sig_pass_to_slave(int signo)
{
- sigset_t allsigs, oldsigs;
int olderrno = errno;
- sigfillset(&allsigs);
- sigprocmask(SIG_BLOCK, &allsigs, &oldsigs);
-
if (slave_pid > 0)
kill(slave_pid, signo);
- sigprocmask(SIG_SETMASK, &oldsigs, NULL);
errno = olderrno;
}
@@ -396,12 +391,8 @@ void
sig_chld(int signo)
{
pid_t pid;
- sigset_t allsigs, oldsigs;
int stat, olderrno = errno;
- sigfillset(&allsigs);
- sigprocmask(SIG_BLOCK, &allsigs, &oldsigs);
-
do {
pid = waitpid(-1, &stat, WNOHANG);
} while (pid == -1 && errno == EINTR);
@@ -411,7 +402,6 @@ sig_chld(int signo)
slave_pid = -1;
}
- sigprocmask(SIG_SETMASK, &oldsigs, NULL);
errno = olderrno;
}