summaryrefslogtreecommitdiff
path: root/sys/kern/tty_tty.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2020-04-08 08:07:53 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2020-04-08 08:07:53 +0000
commitaa2f29d03f17b672a326e6ea9d3c9dac9c32dc7a (patch)
tree822fc976acc6808484d2cf49ae10170823d1b2b5 /sys/kern/tty_tty.c
parent9e8d4e12caf547965622f4e6e0cdf16c6d336fc9 (diff)
Make fifo_kqfilter() honor FREAD|FWRITE just like fifo_poll() does.
Prevent generating events that do not correspond to how the fifo has been opened. ok visa@, millert@
Diffstat (limited to 'sys/kern/tty_tty.c')
-rw-r--r--sys/kern/tty_tty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c
index da4bb63e13e..2aa99721cfc 100644
--- a/sys/kern/tty_tty.c
+++ b/sys/kern/tty_tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_tty.c,v 1.24 2018/05/02 02:24:56 visa Exp $ */
+/* $OpenBSD: tty_tty.c,v 1.25 2020/04/08 08:07:51 mpi Exp $ */
/* $NetBSD: tty_tty.c,v 1.13 1996/03/30 22:24:46 christos Exp $ */
/*-
@@ -160,5 +160,5 @@ cttykqfilter(dev_t dev, struct knote *kn)
if (ttyvp == NULL)
return (ENXIO);
- return (VOP_KQFILTER(ttyvp, kn));
+ return (VOP_KQFILTER(ttyvp, FREAD|FWRITE, kn));
}