summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syslogd/syslogd.c
diff options
context:
space:
mode:
authordoug <doug@openbsd.org>2014-09-08 00:43:42 +0000
committerdoug <doug@openbsd.org>2014-09-08 00:43:42 +0000
commit35cc0c37f6056f5a1a272707e0fb872da8f99aeb (patch)
treee8754e05cd041644fae739d3550fb5475429d3be /usr.sbin/syslogd/syslogd.c
parentthe PR_LOGGING flag is unused, so im cleaning it up (diff)
downloadwireguard-openbsd-35cc0c37f6056f5a1a272707e0fb872da8f99aeb.tar.xz
wireguard-openbsd-35cc0c37f6056f5a1a272707e0fb872da8f99aeb.zip
Fix a syslogd regression when specifying all 20 additional log paths
bluhm@ found and fixed this bug. This is a modified version of his patch which makes the intention a little clearer. ok bluhm@
Diffstat (limited to 'usr.sbin/syslogd/syslogd.c')
-rw-r--r--usr.sbin/syslogd/syslogd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 2ae23c06faf..82684790348 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syslogd.c,v 1.122 2014/09/04 15:19:05 bluhm Exp $ */
+/* $OpenBSD: syslogd.c,v 1.123 2014/09/08 00:43:42 doug Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@@ -453,13 +453,12 @@ main(int argc, char *argv[])
pfd[PFD_UNIX_0 + i].events = POLLIN;
}
- nfunix++;
if (socketpair(AF_UNIX, SOCK_DGRAM, PF_UNSPEC, pair) == -1)
die(0);
fd = pair[0];
double_rbuf(fd);
- pfd[PFD_UNIX_0 + i].fd = fd;
- pfd[PFD_UNIX_0 + i].events = POLLIN;
+ pfd[PFD_SENDSYS].fd = fd;
+ pfd[PFD_SENDSYS].events = POLLIN;
if (ctlsock_path != NULL) {
fd = unix_socket(ctlsock_path, SOCK_STREAM, 0600);
@@ -608,6 +607,8 @@ main(int argc, char *argv[])
unix_read_handler(pfd[PFD_UNIX_0 + i].fd);
}
}
+ if ((pfd[PFD_SENDSYS].revents & POLLIN) != 0)
+ unix_read_handler(pfd[PFD_SENDSYS].fd);
}
/* NOTREACHED */
return (0);