summaryrefslogtreecommitdiff
path: root/sbin/pflogd/privsep.c
diff options
context:
space:
mode:
authorBryan Steele <brynet@cvs.openbsd.org>2017-09-06 12:43:17 +0000
committerBryan Steele <brynet@cvs.openbsd.org>2017-09-06 12:43:17 +0000
commit64d4379ae9220ec45a6af54ddacbb0c41408e2f6 (patch)
treed3a8111747a4546328c902b4b3284cc6aa1f15e9 /sbin/pflogd/privsep.c
parente2d643fa2418b6c75c0a7378f21c791df64a96b7 (diff)
pflogd(8) currently spams the console on shutdown if syslogd(8) wins the
race to die, so just stop logging pflogd exits. This logging probably comes from the fact that pflogd was largely based on syslogd. Removes the annoying "pflogd[23954]: Exiting" messages pointed out by deraadt@ Also cleanup some missed SIGCHLD handling code that is no longer needed. "LGTM" mikeb@
Diffstat (limited to 'sbin/pflogd/privsep.c')
-rw-r--r--sbin/pflogd/privsep.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/sbin/pflogd/privsep.c b/sbin/pflogd/privsep.c
index d5bde071e8b..8ab338443d5 100644
--- a/sbin/pflogd/privsep.c
+++ b/sbin/pflogd/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.28 2017/09/05 15:41:25 brynet Exp $ */
+/* $OpenBSD: privsep.c,v 1.29 2017/09/06 12:43:16 brynet Exp $ */
/*
* Copyright (c) 2003 Can Erkin Acar
@@ -49,10 +49,7 @@ enum cmd_types {
static int priv_fd = -1;
static volatile pid_t child_pid = -1;
-volatile sig_atomic_t gotsig_chld = 0;
-
static void sig_pass_to_chld(int);
-static void sig_chld(int);
static int may_read(int, void *, size_t);
static void must_read(int, void *, size_t);
static void must_write(int, void *, size_t);
@@ -150,7 +147,6 @@ priv_exec(int child, int argc, char *argv[])
signal(SIGHUP, sig_pass_to_chld);
signal(SIGINT, sig_pass_to_chld);
signal(SIGQUIT, sig_pass_to_chld);
- signal(SIGCHLD, sig_chld);
setproctitle("[priv]");
@@ -160,7 +156,7 @@ BROKEN if (pledge("stdio rpath wpath cpath sendfd proc bpf", NULL) == -1)
err(1, "pledge");
#endif
- while (!gotsig_chld) {
+ while (1) {
if (may_read(sock, &cmd, sizeof(int)))
break;
switch (cmd) {
@@ -395,13 +391,6 @@ sig_pass_to_chld(int sig)
errno = oerrno;
}
-/* if parent gets a SIGCHLD, it will exit */
-static void
-sig_chld(int sig)
-{
- gotsig_chld = 1;
-}
-
/* Read all data or return 1 for error. */
static int
may_read(int fd, void *buf, size_t n)