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>
This commit is contained in:
Jonathan Lemon 2000-07-18 21:41:47 +00:00
parent d98c7b9a99
commit 2ba03123c5

View File

@ -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);
}