summaryrefslogtreecommitdiff
path: root/sys/kern/subr_log.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/subr_log.c')
-rw-r--r--sys/kern/subr_log.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c
index 292bf55e35f..98eb65c87ca 100644
--- a/sys/kern/subr_log.c
+++ b/sys/kern/subr_log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_log.c,v 1.10 2003/07/21 22:44:50 tedu Exp $ */
+/* $OpenBSD: subr_log.c,v 1.11 2003/09/23 16:51:12 millert Exp $ */
/* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */
/*
@@ -46,6 +46,7 @@
#include <sys/signalvar.h>
#include <sys/syslog.h>
#include <sys/conf.h>
+#include <sys/poll.h>
#define LOG_RDPRI (PZERO + 1)
@@ -178,25 +179,22 @@ logread(dev, uio, flag)
/*ARGSUSED*/
int
-logselect(dev, rw, p)
+logpoll(dev, events, p)
dev_t dev;
- int rw;
+ int events;
struct proc *p;
{
+ int revents = 0;
int s = splhigh();
- switch (rw) {
-
- case FREAD:
- if (msgbufp->msg_bufr != msgbufp->msg_bufx) {
- splx(s);
- return (1);
- }
- selrecord(p, &logsoftc.sc_selp);
- break;
+ if (events & (POLLIN | POLLRDNORM)) {
+ if (msgbufp->msg_bufr != msgbufp->msg_bufx)
+ revents |= events & (POLLIN | POLLRDNORM);
+ else
+ selrecord(p, &logsoftc.sc_selp);
}
splx(s);
- return (0);
+ return (revents);
}
int