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:
ache 1995-08-02 12:53:14 +00:00
parent 04e9bdb4d4
commit 7c66c4f443

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