summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-08-02 11:20:05 +0000
committerache <ache@FreeBSD.org>1995-08-02 11:20:05 +0000
commit80afbaa558c6d169718db78131fef10b41990429 (patch)
tree93438d4d779496be20608b95618a83830ca955af /libexec
parent3eea849c86b24fe56a24c9206658b0c7c151969f (diff)
downloadFreeBSD-src-80afbaa558c6d169718db78131fef10b41990429.zip
FreeBSD-src-80afbaa558c6d169718db78131fef10b41990429.tar.gz
Use the same DECODE_BAUD trick like in new telnetd to obtain
termios speed. Obtained from: Pre-Lite2 telnet
Diffstat (limited to 'libexec')
-rw-r--r--libexec/telnetd/sys_term.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c
index 75070af..c6b3221 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)
OpenPOWER on IntegriCloud