summaryrefslogtreecommitdiffstats
path: root/usr.bin/tset/map.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-09-09 03:11:15 +0000
committerache <ache@FreeBSD.org>1994-09-09 03:11:15 +0000
commitb67f029f0280a2f51ca65b4d7967a0a8d3a904bd (patch)
treeea9c411e8be61a61cd041a01c59bf9f047102927 /usr.bin/tset/map.c
parentaebfcd0c1d6de92964d9bb3f80cc98c5e66f1d84 (diff)
downloadFreeBSD-src-b67f029f0280a2f51ca65b4d7967a0a8d3a904bd.zip
FreeBSD-src-b67f029f0280a2f51ca65b4d7967a0a8d3a904bd.tar.gz
Speed matching code never successful, because ospeed range is [0..17]
but termios speed range is [0..115200]. Of cource ospeed initialized with wrong value too which cann affects terminals with padding, fixed. 57600,115200 added.
Diffstat (limited to 'usr.bin/tset/map.c')
-rw-r--r--usr.bin/tset/map.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/usr.bin/tset/map.c b/usr.bin/tset/map.c
index 56cb725..b20f43d 100644
--- a/usr.bin/tset/map.c
+++ b/usr.bin/tset/map.c
@@ -42,7 +42,8 @@ static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/9/93";
#include <string.h>
#include "extern.h"
-int baudrate __P((char *));
+extern speed_t Ospeed;
+speed_t baudrate __P((char *));
/* Baud rate conditionals for mapping. */
#define GT 0x01
@@ -57,7 +58,7 @@ typedef struct map {
char *porttype; /* Port type, or "" for any. */
char *type; /* Terminal type to select. */
int conditional; /* Baud rate conditionals bitmask. */
- int speed; /* Baud rate to compare against. */
+ speed_t speed; /* Baud rate to compare against. */
} MAP;
MAP *cur, *maplist;
@@ -195,19 +196,19 @@ mapped(type)
match = 1;
break;
case EQ:
- match = (ospeed == mapp->speed);
+ match = (Ospeed == mapp->speed);
break;
case GE:
- match = (ospeed >= mapp->speed);
+ match = (Ospeed >= mapp->speed);
break;
case GT:
- match = (ospeed > mapp->speed);
+ match = (Ospeed > mapp->speed);
break;
case LE:
- match = (ospeed <= mapp->speed);
+ match = (Ospeed <= mapp->speed);
break;
case LT:
- match = (ospeed < mapp->speed);
+ match = (Ospeed < mapp->speed);
break;
}
if (match)
@@ -219,7 +220,7 @@ mapped(type)
typedef struct speeds {
char *string;
- int speed;
+ speed_t speed;
} SPEEDS;
SPEEDS speeds[] = {
@@ -242,10 +243,16 @@ SPEEDS speeds[] = {
"38400", B38400,
"exta", B19200,
"extb", B38400,
+#ifdef B57600
+ "57600", B57600,
+#endif
+#ifdef B115200
+ "115200", B115200,
+#endif
NULL
};
-int
+speed_t
baudrate(rate)
char *rate;
{
OpenPOWER on IntegriCloud