summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2021-12-20 16:21:08 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2021-12-20 16:21:08 +0000
commit340a7cff1be5af7c73a23637cae57d31a705107e (patch)
treea169af6df8d027a4bd8e9586e5f57be3fd68065e /sys
parent30e42e456d6df328420de84fe07366e2edf7a1cd (diff)
Run seltrue/dead event filter in modify and process callbacks
Do not assume event status in the modify and process callbacks. Instead always run the event filter so that it has a chance to set knote flags. The filter can also indicate event inactivity.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_event.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 1a9efde3b52..fc86896c29c 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_event.c,v 1.175 2021/12/11 09:28:26 visa Exp $ */
+/* $OpenBSD: kern_event.c,v 1.176 2021/12/20 16:21:07 visa Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
@@ -584,14 +584,18 @@ int
filt_seltruemodify(struct kevent *kev, struct knote *kn)
{
knote_modify(kev, kn);
- return (1);
+ return (kn->kn_fop->f_event(kn, 0));
}
int
filt_seltrueprocess(struct knote *kn, struct kevent *kev)
{
- knote_submit(kn, kev);
- return (1);
+ int active;
+
+ active = kn->kn_fop->f_event(kn, 0);
+ if (active)
+ knote_submit(kn, kev);
+ return (active);
}
/*