summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/ugen.c19
-rw-r--r--sys/dev/usb/uhid.c13
-rw-r--r--sys/miscfs/fuse/fuse_device.c13
3 files changed, 8 insertions, 37 deletions
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index a4c92398238..9128ffd1d46 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ugen.c,v 1.105 2020/04/07 13:27:51 visa Exp $ */
+/* $OpenBSD: ugen.c,v 1.106 2020/05/13 08:13:42 mpi Exp $ */
/* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */
/* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -1342,13 +1342,6 @@ const struct filterops ugenread_isoc_filtops = {
.f_event = filt_ugenread_isoc,
};
-const struct filterops ugen_seltrue_filtops = {
- .f_flags = FILTEROP_ISFD,
- .f_attach = NULL,
- .f_detach = filt_ugenrdetach,
- .f_event = filt_seltrue,
-};
-
int
ugenkqfilter(dev_t dev, struct knote *kn)
{
@@ -1378,13 +1371,11 @@ ugenkqfilter(dev_t dev, struct knote *kn)
kn->kn_fop = &ugenread_isoc_filtops;
break;
case UE_BULK:
- /*
+ /*
* We have no easy way of determining if a read will
* yield any data or a write will happen.
- * So, emulate "seltrue".
*/
- kn->kn_fop = &ugen_seltrue_filtops;
- break;
+ return (seltrue_kqfilter(dev, kn));
default:
return (EINVAL);
}
@@ -1402,10 +1393,8 @@ ugenkqfilter(dev_t dev, struct knote *kn)
/*
* We have no easy way of determining if a read will
* yield any data or a write will happen.
- * So, emulate "seltrue".
*/
- kn->kn_fop = &ugen_seltrue_filtops;
- break;
+ return (seltrue_kqfilter(dev, kn));
default:
return (EINVAL);
}
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index d72d5e150b9..d8e5f8f7ddc 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhid.c,v 1.79 2020/04/07 13:27:51 visa Exp $ */
+/* $OpenBSD: uhid.c,v 1.80 2020/05/13 08:13:42 mpi Exp $ */
/* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -467,13 +467,6 @@ const struct filterops uhidread_filtops = {
.f_event = filt_uhidread,
};
-const struct filterops uhid_seltrue_filtops = {
- .f_flags = FILTEROP_ISFD,
- .f_attach = NULL,
- .f_detach = filt_uhidrdetach,
- .f_event = filt_seltrue,
-};
-
int
uhidkqfilter(dev_t dev, struct knote *kn)
{
@@ -494,9 +487,7 @@ uhidkqfilter(dev_t dev, struct knote *kn)
break;
case EVFILT_WRITE:
- klist = &sc->sc_rsel.si_note;
- kn->kn_fop = &uhid_seltrue_filtops;
- break;
+ return (seltrue_kqfilter(dev, kn));
default:
return (EINVAL);
diff --git a/sys/miscfs/fuse/fuse_device.c b/sys/miscfs/fuse/fuse_device.c
index af0a77f44c2..33d16a15a9b 100644
--- a/sys/miscfs/fuse/fuse_device.c
+++ b/sys/miscfs/fuse/fuse_device.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse_device.c,v 1.33 2020/04/07 13:27:51 visa Exp $ */
+/* $OpenBSD: fuse_device.c,v 1.34 2020/05/13 08:13:42 mpi Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -76,13 +76,6 @@ const static struct filterops fuse_rd_filtops = {
.f_event = filt_fuse_read,
};
-const static struct filterops fuse_seltrue_filtops = {
- .f_flags = FILTEROP_ISFD,
- .f_attach = NULL,
- .f_detach = filt_fuse_rdetach,
- .f_event = filt_seltrue,
-};
-
#ifdef FUSE_DEBUG
static void
fuse_dump_buff(char *buff, int len)
@@ -555,9 +548,7 @@ fusekqfilter(dev_t dev, struct knote *kn)
kn->kn_fop = &fuse_rd_filtops;
break;
case EVFILT_WRITE:
- klist = &fd->fd_rsel.si_note;
- kn->kn_fop = &fuse_seltrue_filtops;
- break;
+ return (seltrue_kqfilter(dev, kn));
default:
return (EINVAL);
}