summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_compat.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-08-02 12:53:14 +0000
committerache <ache@FreeBSD.org>1995-08-02 12:53:14 +0000
commit2fcbb0e5924dba4835a362cf48e446d11a9a4b87 (patch)
tree93dbe55b4247e4d8eb007aa87ee13c7dbe49967e /sys/kern/tty_compat.c
parent0d69a2d42f74f769cdcc92c0000af824dd515cc5 (diff)
downloadFreeBSD-src-2fcbb0e5924dba4835a362cf48e446d11a9a4b87.zip
FreeBSD-src-2fcbb0e5924dba4835a362cf48e446d11a9a4b87.tar.gz
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.
Diffstat (limited to 'sys/kern/tty_compat.c')
-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 b266b56..fabc96b 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);
OpenPOWER on IntegriCloud