summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarance A Drosehn <gad@FreeBSD.org>2001-04-04 23:27:35 +0000
committerGarance A Drosehn <gad@FreeBSD.org>2001-04-04 23:27:35 +0000
commit0832fc64942c39ee59c3b3890515cbb94c79c48b (patch)
tree449ca65b05b1308b512be7547dfc558a22094837
parent0cad4cb4e6bb4390037c5daf327bc212f2e9e920 (diff)
Notes
-rw-r--r--sys/net/bpf.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 74a8c5bbd0ff..c947c1a860b4 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -972,18 +972,21 @@ bpfpoll(dev, events, p)
struct proc *p;
{
struct bpf_d *d;
- int revents = 0;
+ int revents;
- /*
- * An imitation of the FIONREAD ioctl code.
- */
d = dev->si_drv1;
-
if (d->bd_bif == NULL)
return (ENXIO);
+ revents = events & (POLLOUT | POLLWRNORM);
BPFD_LOCK(d);
if (events & (POLLIN | POLLRDNORM)) {
+ /*
+ * An imitation of the FIONREAD ioctl code.
+ * XXX not quite. An exact imitation:
+ * if (d->b_slen != 0 ||
+ * (d->bd_hbuf != NULL && d->bd_hlen != 0)
+ */
if (d->bd_hlen != 0 || (d->bd_immediate && d->bd_slen != 0))
revents |= events & (POLLIN | POLLRDNORM);
else