1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

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.
This commit is contained in:
Andrey A. Chernov 1995-08-02 12:53:14 +00:00
parent 7ce7bdd607
commit e581051d3d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=9861

View File

@ -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);