diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2021-12-20 16:22:25 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2021-12-20 16:22:25 +0000 |
commit | e0261a0fe1ba151aaee365fbfb4d2080ee71d66d (patch) | |
tree | 3b48c10d7d3e2d653e613b6bd8988c0d7bcc0b17 | |
parent | 340a7cff1be5af7c73a23637cae57d31a705107e (diff) |
Let poll(2) register EVFILT_EXCEPT filter with dead vnodes
This enables the system deliver POLLHUP when pollfd.events == 0.
-rw-r--r-- | sys/miscfs/deadfs/dead_vnops.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/miscfs/deadfs/dead_vnops.c b/sys/miscfs/deadfs/dead_vnops.c index c36111f1cb2..3459569c0e6 100644 --- a/sys/miscfs/deadfs/dead_vnops.c +++ b/sys/miscfs/deadfs/dead_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dead_vnops.c,v 1.39 2021/12/12 09:14:59 visa Exp $ */ +/* $OpenBSD: dead_vnops.c,v 1.40 2021/12/20 16:22:24 visa Exp $ */ /* $NetBSD: dead_vnops.c,v 1.16 1996/02/13 13:12:48 mycroft Exp $ */ /* @@ -180,6 +180,11 @@ dead_kqfilter(void *v) case EVFILT_WRITE: ap->a_kn->kn_fop = &dead_filtops; break; + case EVFILT_EXCEPT: + if ((ap->a_kn->kn_flags & __EV_POLL) == 0) + return (EINVAL); + ap->a_kn->kn_fop = &dead_filtops; + break; default: return (EINVAL); } |