summaryrefslogtreecommitdiffstats
path: root/usr.bin/telnet
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-08-02 11:13:30 +0000
committerache <ache@FreeBSD.org>1995-08-02 11:13:30 +0000
commit3eea849c86b24fe56a24c9206658b0c7c151969f (patch)
treec3aa37f7b7be47994b5e294d47aa16fb48101373 /usr.bin/telnet
parent46c8945e4166bb45c4bad858f32625b082d586e6 (diff)
downloadFreeBSD-src-3eea849c86b24fe56a24c9206658b0c7c151969f.zip
FreeBSD-src-3eea849c86b24fe56a24c9206658b0c7c151969f.tar.gz
Use the same DECODE_BAUD trick like in new telnet to set
termios speed Obtained from: Pre-Lite2 telnet
Diffstat (limited to 'usr.bin/telnet')
-rw-r--r--usr.bin/telnet/sys_bsd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/usr.bin/telnet/sys_bsd.c b/usr.bin/telnet/sys_bsd.c
index c55f85a..f08161c 100644
--- a/usr.bin/telnet/sys_bsd.c
+++ b/usr.bin/telnet/sys_bsd.c
@@ -704,6 +704,14 @@ TerminalNewMode(f)
}
+/*
+ * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD).
+ */
+#if B4800 != 4800
+#define DECODE_BAUD
+#endif
+
+#ifdef DECODE_BAUD
#ifndef B19200
# define B19200 B9600
#endif
@@ -728,13 +736,16 @@ struct termspeeds {
{ 4800, B4800 }, { 9600, B9600 }, { 19200, B19200 },
{ 38400, B38400 }, { -1, B38400 }
};
+#endif /* DECODE_BAUD */
void
TerminalSpeeds(ispeed, ospeed)
long *ispeed;
long *ospeed;
{
+#ifdef DECODE_BAUD
register struct termspeeds *tp;
+#endif /* DECODE_BAUD */
register long in, out;
out = cfgetospeed(&old_tc);
@@ -742,6 +753,7 @@ TerminalSpeeds(ispeed, ospeed)
if (in == 0)
in = out;
+#ifdef DECODE_BAUD
tp = termspeeds;
while ((tp->speed != -1) && (tp->value < in))
tp++;
@@ -751,6 +763,10 @@ TerminalSpeeds(ispeed, ospeed)
while ((tp->speed != -1) && (tp->value < out))
tp++;
*ospeed = tp->speed;
+#else /* DECODE_BAUD */
+ *ispeed = in;
+ *ospeed = out;
+#endif /* DECODE_BAUD */
}
int
OpenPOWER on IntegriCloud