From f1170022ce802ed3d73a24b97ab3149a90a61324 Mon Sep 17 00:00:00 2001 From: mycroft Date: Tue, 16 Dec 1997 22:52:37 +0000 Subject: [PATCH] Don't do anything in comparam() if the line speed and flags are the same. --- sys/dev/ic/com.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index 7387f9e0d0f5..824c676baa10 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.128 1997/11/03 08:20:35 mycroft Exp $ */ +/* $NetBSD: com.c,v 1.129 1997/12/16 22:52:37 mycroft Exp $ */ /*- * Copyright (c) 1993, 1994, 1995, 1996, 1997 @@ -610,6 +610,8 @@ comopen(dev, flag, mode, p) SET(t.c_cflag, CRTSCTS); if (ISSET(sc->sc_swflags, TIOCFLAG_MDMBUF)) SET(t.c_cflag, MDMBUF); + /* Make sure comparam() will do something. */ + tp->t_ospeed = 0; (void) comparam(tp, &t); tp->t_iflag = TTYDEF_IFLAG; tp->t_oflag = TTYDEF_OFLAG; @@ -996,6 +998,15 @@ comparam(tp, t) CLR(t->c_cflag, HUPCL); } + /* + * If there were no changes, don't do anything. This avoids dropping + * input and improves performance when all we did was frob things like + * VMIN and VTIME. + */ + if (tp->t_ospeed == t->c_ospeed && + tp->t_cflag == t->c_cflag) + return (0); + lcr = ISSET(sc->sc_lcr, LCR_SBREAK) | cflag2lcr(t->c_cflag); s = splserial();