Index: sys_generic.c =================================================================== RCS file: /home/ncvs/src/sys/kern/sys_generic.c,v retrieving revision 1.110 diff -u -r1.110 sys_generic.c --- sys_generic.c 17 Aug 2002 02:36:16 -0000 1.110 +++ sys_generic.c 23 Aug 2002 01:14:56 -0000 @@ -795,6 +795,8 @@ atv.tv_usec = 0; } timo = 0; + /* XXX Is there a better place for this? */ + TAILQ_INIT(&td->td_selq); mtx_lock(&sellock); retry: ncoll = nselcoll; @@ -803,8 +805,6 @@ mtx_unlock_spin(&sched_lock); mtx_unlock(&sellock); - /* XXX Is there a better place for this? */ - TAILQ_INIT(&td->td_selq); error = selscan(td, ibits, obits, uap->nd); mtx_lock(&sellock); if (error || td->td_retval[0]) @@ -828,6 +828,7 @@ mtx_lock_spin(&sched_lock); if ((td->td_flags & TDF_SELECT) == 0 || nselcoll != ncoll) { mtx_unlock_spin(&sched_lock); + clear_selinfo_list(td); goto retry; } mtx_unlock_spin(&sched_lock); @@ -975,6 +976,8 @@ atv.tv_usec = 0; } timo = 0; + /* XXX Is there a better place for this? */ + TAILQ_INIT(&td->td_selq); mtx_lock(&sellock); retry: ncoll = nselcoll; @@ -983,8 +986,6 @@ mtx_unlock_spin(&sched_lock); mtx_unlock(&sellock); - /* XXX Is there a better place for this? */ - TAILQ_INIT(&td->td_selq); error = pollscan(td, (struct pollfd *)bits, nfds); mtx_lock(&sellock); if (error || td->td_retval[0]) @@ -1006,6 +1007,7 @@ mtx_lock_spin(&sched_lock); if ((td->td_flags & TDF_SELECT) == 0 || nselcoll != ncoll) { mtx_unlock_spin(&sched_lock); + clear_selinfo_list(td); goto retry; } mtx_unlock_spin(&sched_lock);