diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2020-04-08 08:01:53 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2020-04-08 08:01:53 +0000 |
commit | 9e8d4e12caf547965622f4e6e0cdf16c6d336fc9 (patch) | |
tree | ebe51baef01b45e112a5086f251c804898ba7a4b | |
parent | 1c744abd28db81ba9b2296822c9a37011a2e6fa4 (diff) |
Pass correct socket to the write kqueue filter.
Make EVFILT_WRITE notifications on fifo work.
ok visa@, millert@
-rw-r--r-- | sys/miscfs/fifofs/fifo_vnops.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index 26e01322a1e..221826cb699 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fifo_vnops.c,v 1.74 2020/04/07 13:27:51 visa Exp $ */ +/* $OpenBSD: fifo_vnops.c,v 1.75 2020/04/08 08:01:52 mpi Exp $ */ /* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */ /* @@ -507,16 +507,19 @@ int fifo_kqfilter(void *v) { struct vop_kqfilter_args *ap = v; - struct socket *so = (struct socket *)ap->a_vp->v_fifoinfo->fi_readsock; + struct fifoinfo *fip = ap->a_vp->v_fifoinfo; struct sockbuf *sb; + struct socket *so; switch (ap->a_kn->kn_filter) { case EVFILT_READ: ap->a_kn->kn_fop = &fiforead_filtops; + so = fip->fi_readsock; sb = &so->so_rcv; break; case EVFILT_WRITE: ap->a_kn->kn_fop = &fifowrite_filtops; + so = fip->fi_writesock; sb = &so->so_snd; break; default: |