Use the same DECODE_BAUD trick like in new telnetd to obtain
termios speed. Obtained from: Pre-Lite2 telnet
This commit is contained in:
parent
3eea849c86
commit
80afbaa558
@ -949,6 +949,14 @@ tty_iscrnl()
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD).
|
||||
*/
|
||||
#if B4800 != 4800
|
||||
#define DECODE_BAUD
|
||||
#endif
|
||||
|
||||
#ifdef DECODE_BAUD
|
||||
/*
|
||||
* A table of available terminal speeds
|
||||
*/
|
||||
@ -963,27 +971,36 @@ struct termspeeds {
|
||||
{ 4800, B4800 }, { 9600, B9600 }, { 19200, B9600 },
|
||||
{ 38400, B9600 }, { -1, B9600 }
|
||||
};
|
||||
#endif /* DECODE_BUAD */
|
||||
|
||||
void
|
||||
tty_tspeed(val)
|
||||
int val;
|
||||
{
|
||||
#ifdef DECODE_BAUD
|
||||
register struct termspeeds *tp;
|
||||
|
||||
for (tp = termspeeds; (tp->speed != -1) && (val > tp->speed); tp++)
|
||||
;
|
||||
cfsetospeed(&termbuf, tp->value);
|
||||
#else /* DECODE_BUAD */
|
||||
cfsetospeed(&termbuf, val);
|
||||
#endif /* DECODE_BUAD */
|
||||
}
|
||||
|
||||
void
|
||||
tty_rspeed(val)
|
||||
int val;
|
||||
{
|
||||
#ifdef DECODE_BAUD
|
||||
register struct termspeeds *tp;
|
||||
|
||||
for (tp = termspeeds; (tp->speed != -1) && (val > tp->speed); tp++)
|
||||
;
|
||||
cfsetispeed(&termbuf, tp->value);
|
||||
#else /* DECODE_BAUD */
|
||||
cfsetispeed(&termbuf, val);
|
||||
#endif /* DECODE_BAUD */
|
||||
}
|
||||
|
||||
#if defined(CRAY2) && defined(UNICOS5)
|
||||
|
Loading…
x
Reference in New Issue
Block a user