Allow it works with non-fixed termios speeds.

Replace ospeed switch with new _set_ospeed
This commit is contained in:
ache 1995-08-04 06:54:18 +00:00
parent 5a71fa1d92
commit 58af62e155
2 changed files with 9 additions and 7 deletions

View File

@ -42,7 +42,6 @@ static char sccsid[] = "@(#)ttgeneric.c 8.1 (Berkeley) 6/6/93";
#include "tt.h"
char PC, *BC, *UP;
short ospeed;
/* normal frame */
short gen_frame[16] = {
@ -393,7 +392,6 @@ tt_generic()
{
gen_PC = tttgetstr("pc");
PC = gen_PC ? *gen_PC->ts_str : 0;
ospeed = wwospeed;
gen_CM = ttxgetstr("cm"); /* may not work */
gen_IM = ttxgetstr("im");

View File

@ -42,6 +42,7 @@ static char sccsid[] = "@(#)wwinit.c 8.1 (Berkeley) 6/6/93";
#include "tt.h"
#include <sys/signal.h>
#include <fcntl.h>
#include <termcap.h>
#include "char.h"
wwinit()
@ -122,11 +123,8 @@ wwinit()
goto bad;
}
#ifdef OLD_TTY
wwospeed = wwoldtty.ww_sgttyb.sg_ospeed;
#else
wwospeed = cfgetospeed(&wwoldtty.ww_termios);
#endif
switch (wwospeed) {
ospeed = wwoldtty.ww_sgttyb.sg_ospeed;
switch (ospeed) {
default:
case B0:
goto bad;
@ -194,6 +192,12 @@ wwinit()
break;
#endif
}
#else
if ((wwbaud = cfgetospeed(&wwoldtty.ww_termios)) == B0)
goto bad;
_set_ospeed(wwbaud);
#endif
wwospeed = ospeed;
if (xxinit() < 0)
goto bad;