* Use |= instead of =. The related structure was bzero'd so the effect
is the same but this reduces potential confusion.
* Interlock open attempts against termination by setting
* PF_TERMINATED. This allows us to block while cleaning
* out the device infrastructure.
+ *
+ * Do not terminate the tty if it still has a session
+ * association.
*/
- if ((pti->pt_flags2 & (PF_SOPEN|PF_MOPEN)) == 0) {
+ if ((pti->pt_flags2 & (PF_SOPEN|PF_MOPEN)) == 0 &&
+ pti->pt_tty.t_session == NULL) {
pti->pt_flags2 |= PF_TERMINATED;
uminor_no = pti->pt_uminor;
bzero((caddr_t)ssb, sizeof (*ssb));
if (asb.ssb_flags & SSB_KNOTE) {
ssb->ssb_kq.ki_note = asb.ssb_kq.ki_note;
- ssb->ssb_flags = SSB_KNOTE;
+ ssb->ssb_flags |= SSB_KNOTE;
}
crit_exit();