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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136492

View File

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