From 934ebfaf1b412e6004776b10b69d1494302264d3 Mon Sep 17 00:00:00 2001 From: yokota Date: Tue, 29 Jun 1999 17:30:33 +0000 Subject: Fill in tp->t_windowsize AFTER the call to (*linesw[tp->t_line].l_open)(), rather than BEFORE the call. Otherwise the structure will be `zero'ed out by l_open, which actually is ttyopen(), if !TS_OPEN. PR: kern/12420 --- sys/dev/syscons/syscons.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sys/dev/syscons/syscons.c') diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index c71294d9..eac6d4e 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.c,v 1.308 1999/06/24 09:21:27 yokota Exp $ + * $Id: syscons.c,v 1.309 1999/06/26 11:00:17 peter Exp $ */ #include "sc.h" @@ -481,6 +481,7 @@ scopen(dev_t dev, int flag, int mode, struct proc *p) int unit = scdevtounit(dev); sc_softc_t *sc; keyarg_t key; + int error; if (!tp) return(ENXIO); @@ -518,6 +519,9 @@ scopen(dev_t dev, int flag, int mode, struct proc *p) else if (tp->t_state & TS_XCLUDE && suser(p)) return(EBUSY); + + error = (*linesw[tp->t_line].l_open)(dev, tp); + if ((SC_VTY(dev) != SC_CONSOLECTL) && (SC_VTY(dev) != SC_MOUSE)) { /* assert(sc != NULL) */ if (sc->console[SC_VTY(dev) - sc->first_vty] == NULL) { @@ -534,7 +538,7 @@ scopen(dev_t dev, int flag, int mode, struct proc *p) = sc->console[SC_VTY(dev) - sc->first_vty]->ysize; } } - return ((*linesw[tp->t_line].l_open)(dev, tp)); + return error; } int -- cgit v1.1