+ /*
+ * Null out the backing TTY struct's open procedure to prevent starting
+ * slaves through `ptsstart`.
+ */
+ tp->t_oproc = NULL;
+
+ /*
+ * Clear any select or kevent waiters under the lock.
+ */
+ SLIST_FOREACH(kn, &pti->pt_selr.si_note, kn_selnext) {
+ KNOTE_DETACH(&pti->pt_selr.si_note, kn);
+ }
+ selthreadclear(&pti->pt_selr);
+ SLIST_FOREACH(kn, &pti->pt_selw.si_note, kn_selnext) {
+ KNOTE_DETACH(&pti->pt_selw.si_note, kn);
+ }
+ selthreadclear(&pti->pt_selw);