fix a bug where signal events didn't set the flags for attach/detach..

PR:		72234
MFC after:	2 days
This commit is contained in:
John-Mark Gurney 2004-10-13 20:55:19 +00:00
parent b8a2c7ca02
commit d46316e8f9

View File

@ -441,6 +441,7 @@ filt_timerattach(struct knote *kn)
} }
kn->kn_flags |= EV_CLEAR; /* automatically set */ kn->kn_flags |= EV_CLEAR; /* automatically set */
kn->kn_flags &= ~EV_DETACHED; /* knlist_add usually sets it */
MALLOC(calloutp, struct callout *, sizeof(*calloutp), MALLOC(calloutp, struct callout *, sizeof(*calloutp),
M_KQUEUE, M_WAITOK); M_KQUEUE, M_WAITOK);
callout_init(calloutp, 1); callout_init(calloutp, 1);
@ -461,6 +462,7 @@ filt_timerdetach(struct knote *kn)
callout_drain(calloutp); callout_drain(calloutp);
FREE(calloutp, M_KQUEUE); FREE(calloutp, M_KQUEUE);
atomic_add_int(&kq_ncallouts, -1); atomic_add_int(&kq_ncallouts, -1);
kn->kn_flags |= EV_DETACHED; /* knlist_remove usually clears it */
} }
/* XXX - move to kern_timeout.c? */ /* XXX - move to kern_timeout.c? */