Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Set tp->t_dev to the correct dev_t value in both pt...



details:   https://anonhg.NetBSD.org/src/rev/88cb6ab6236d
branches:  trunk
changeset: 782184:88cb6ab6236d
user:      apb <apb%NetBSD.org@localhost>
date:      Sat Oct 20 00:21:10 2012 +0000

description:
Set tp->t_dev to the correct dev_t value in both ptmopen and ptsopen.
Depending on how the pty had been opened, t_dev could previously have
been set to NODEV.  This was probably harmless before, but it caused the
compatibility handler for the COMPAT_60_TIOCPTSNAME ioctl to fail for
ptys that were allocated by screen(1), but only if this was the first
time that the pty had ever been used.

diffstat:

 sys/kern/tty_pty.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 186f28f4ad7e -r 88cb6ab6236d sys/kern/tty_pty.c
--- a/sys/kern/tty_pty.c        Fri Oct 19 23:07:03 2012 +0000
+++ b/sys/kern/tty_pty.c        Sat Oct 20 00:21:10 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty_pty.c,v 1.131 2011/09/24 04:10:03 christos Exp $   */
+/*     $NetBSD: tty_pty.c,v 1.132 2012/10/20 00:21:10 apb Exp $        */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.131 2011/09/24 04:10:03 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.132 2012/10/20 00:21:10 apb Exp $");
 
 #include "opt_ptm.h"
 
@@ -338,6 +338,7 @@
        pti = pt_softc[ptn];
        tp = pti->pt_tty;
        if (!ISSET(tp->t_state, TS_ISOPEN)) {
+               tp->t_dev = dev;
                ttychars(tp);           /* Set up default chars */
                tp->t_iflag = TTYDEF_IFLAG;
                tp->t_oflag = TTYDEF_OFLAG;
@@ -569,6 +570,7 @@
                mutex_spin_exit(&tty_lock);
                return EIO;
        }
+       tp->t_dev = dev;
        tp->t_oproc = ptsstart;
        mutex_spin_exit(&tty_lock);
        (void)(*tp->t_linesw->l_modem)(tp, 1);



Home | Main Index | Thread Index | Old Index