kernel - minor flags coding change
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 21 Aug 2010 21:12:30 +0000 (14:12 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 21 Aug 2010 21:12:30 +0000 (14:12 -0700)
* Use |= instead of =.  The related structure was bzero'd so the effect
  is the same but this reduces potential confusion.

sys/kern/tty_pty.c
sys/kern/uipc_socket.c

index 9c1911b..163dfc3 100644 (file)
@@ -302,8 +302,12 @@ pti_done(struct pt_ioctl *pti)
                 * 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;
 
index a684650..e170714 100644 (file)
@@ -1188,7 +1188,7 @@ sorflush(struct socket *so)
        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();