diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2020-06-15 15:42:12 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2020-06-15 15:42:12 +0000 |
commit | 7686a658798236de22550e4a727dbbc5afc3b3db (patch) | |
tree | 5ad5964e95ae323a6c8d1ab3daa3dfa1e5961223 /sys/kern | |
parent | 86476d56c2cae894d47711779ba6feee8523ce25 (diff) |
Implement a simple kqfilter for deadfs matching its poll handler.
ok visa@, millert@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_event.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index ac793bd2045..4d0e2c88c5f 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_event.c,v 1.138 2020/06/15 13:18:33 visa Exp $ */ +/* $OpenBSD: kern_event.c,v 1.139 2020/06/15 15:42:11 mpi Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> @@ -487,6 +487,8 @@ static int filt_dead(struct knote *kn, long hint) { kn->kn_flags |= (EV_EOF | EV_ONESHOT); + if (kn->kn_flags & __EV_POLL) + kn->kn_flags |= __EV_HUP; kn->kn_data = 0; return (1); } @@ -497,7 +499,7 @@ filt_deaddetach(struct knote *kn) /* Nothing to do */ } -static const struct filterops dead_filtops = { +const struct filterops dead_filtops = { .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_deaddetach, |