diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 1995-08-02 11:20:05 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 1995-08-02 11:20:05 +0000 |
| commit | 955db62afa90aca44166b4845c25c9b933ed3290 (patch) | |
| tree | 93438d4d779496be20608b95618a83830ca955af | |
| parent | b418143d618e7183be78841383de4ed5ac024286 (diff) | |
Notes
| -rw-r--r-- | libexec/telnetd/sys_term.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c index 75070af90b35..c6b3221ae0c6 100644 --- a/libexec/telnetd/sys_term.c +++ b/libexec/telnetd/sys_term.c @@ -950,6 +950,14 @@ tty_iscrnl() } /* + * 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 */ struct termspeeds { @@ -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) |
