aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1995-08-02 12:53:14 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1995-08-02 12:53:14 +0000
commite581051d3d9db256c468011ce1950e520397ba63 (patch)
tree93dbe55b4247e4d8eb007aa87ee13c7dbe49967e /sys
parent7ce7bdd607d565f13e0579cadb07ca5e2cc03c1d (diff)
downloadsrc-e581051d3d9db256c468011ce1950e520397ba63.tar.gz
src-e581051d3d9db256c468011ce1950e520397ba63.zip
Preserve current termios speed for TIOCSET*, if it matched with
nearest valid. It means that gtty+stty transaction (without speed change) not breaks non-standard speeds now.
Notes
Notes: svn path=/head/; revision=9861
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/tty_compat.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/kern/tty_compat.c b/sys/kern/tty_compat.c
index b266b56859d9..fabc96b684cf 100644
--- a/sys/kern/tty_compat.c
+++ b/sys/kern/tty_compat.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tty_compat.c 8.1 (Berkeley) 6/10/93
- * $Id: tty_compat.c,v 1.15 1995/08/02 06:55:35 ache Exp $
+ * $Id: tty_compat.c,v 1.16 1995/08/02 12:03:12 ache Exp $
*/
/*
@@ -110,12 +110,16 @@ int ttsetcompat(tp, com, data, term)
if ((speed = sg->sg_ispeed) > MAX_SPEED || speed < 0)
return(EINVAL);
- else
+ else if (speed != ttcompatspeedtab(tp->t_ispeed, compatspeeds))
term->c_ispeed = compatspcodes[speed];
+ else
+ term->c_ispeed = tp->t_ispeed;
if ((speed = sg->sg_ospeed) > MAX_SPEED || speed < 0)
return(EINVAL);
- else
+ else if (speed != ttcompatspeedtab(tp->t_ospeed, compatspeeds))
term->c_ospeed = compatspcodes[speed];
+ else
+ term->c_ospeed = tp->t_ospeed;
term->c_cc[VERASE] = sg->sg_erase;
term->c_cc[VKILL] = sg->sg_kill;
tp->t_flags = (tp->t_flags&0xffff0000) | (sg->sg_flags&0xffff);