From: visa Date: Mon, 20 Dec 2021 16:21:07 +0000 (+0000) Subject: Run seltrue/dead event filter in modify and process callbacks X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=69e8f6418b1659cda0a6efe8fb044ac8ece528d0;p=openbsd 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. --- 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 @@ -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); } /*