kernel - Fix system lockup w/ kqueue based select/poll due to dup2()
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 21 Aug 2010 21:00:49 +0000 (14:00 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 21 Aug 2010 21:00:49 +0000 (14:00 -0700)
commit34e191bd0d5b8cb3e96c427a1d2f32bd96fc0aba
treea7ffe17d7a4d30a5620c1a3627b3c5a9125c4416
parent15bcc4a7f120f96131ffccb42da86d7c3ab7645c
kernel - Fix system lockup w/ kqueue based select/poll due to dup2()

* dup2() was not calling knote_fdclose() on the original descriptor being
  replaced

* fdfree() (called by exit) was not cleaning out knotes either, though
  exit*() probably took care of it already when it closed the descriptors.

* Assert that a file has no knotes on the last fdrop().

Reported-by: everyone + lentferj + alexh + swildner + Studbolt
sys/kern/kern_descrip.c
sys/kern/kern_event.c