From b67f029f0280a2f51ca65b4d7967a0a8d3a904bd Mon Sep 17 00:00:00 2001 From: ache Date: Fri, 9 Sep 1994 03:11:15 +0000 Subject: 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. --- usr.bin/tset/map.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'usr.bin/tset/map.c') 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 #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; { -- cgit v1.1