diff options
author | jlemon <jlemon@FreeBSD.org> | 2000-07-18 21:41:47 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2000-07-18 21:41:47 +0000 |
commit | f793ebc47960cacc9913e95462391a55be39e13b (patch) | |
tree | b59e1cdbb0d34a83867b0c8ba2ddc88227ef6263 /sys/kern/kern_event.c | |
parent | 1107e981d086ea017448cc46cbeb7f50ead30f1c (diff) | |
download | FreeBSD-src-f793ebc47960cacc9913e95462391a55be39e13b.zip FreeBSD-src-f793ebc47960cacc9913e95462391a55be39e13b.tar.gz |
Fix a bug which would cause some knotes to get lost when two kqueues
were being used in a process at the same time.
Test case provided by: Chris Peiffer <peifferc@CS.Stanford.EDU>
Diffstat (limited to 'sys/kern/kern_event.c')
-rw-r--r-- | sys/kern/kern_event.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 724b568..2f1a390 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -311,7 +311,8 @@ kqueue(struct proc *p, struct kqueue_args *uap) TAILQ_INIT(&kq->kq_head); fp->f_data = (caddr_t)kq; p->p_retval[0] = fd; - fdp->fd_knlistsize = 0; /* mark this fdesc as having a kq */ + if (fdp->fd_knlistsize < 0) + fdp->fd_knlistsize = 0; /* this process has a kq */ kq->kq_fdp = fdp; return (error); } |