summaryrefslogtreecommitdiff
path: root/usr.bin/tset/map.c
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1995-08-04 06:44:54 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1995-08-04 06:44:54 +0000
commit252f47a817aa489cf1de6645d8561144053c76d3 (patch)
tree8cc5bb9a77228b44f029852032cc3423734669d3 /usr.bin/tset/map.c
parent2f0c493d092ff843fd61926ae4f3827b1f002032 (diff)
downloadsrc-test2-252f47a817aa489cf1de6645d8561144053c76d3.tar.gz
src-test2-252f47a817aa489cf1de6645d8561144053c76d3.zip
Make tset works with non-fixed termios speeds too.
Eliminate ospeed switch using new _set_ospeed function
Notes
Notes: svn path=/head/; revision=9888
Diffstat (limited to 'usr.bin/tset/map.c')
-rw-r--r--usr.bin/tset/map.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/usr.bin/tset/map.c b/usr.bin/tset/map.c
index b20f43d3808f..2e71d2c502b4 100644
--- a/usr.bin/tset/map.c
+++ b/usr.bin/tset/map.c
@@ -225,30 +225,9 @@ typedef struct speeds {
SPEEDS speeds[] = {
"0", B0,
- "50", B50,
- "75", B75,
- "110", B110,
- "134", B134,
"134.5", B134,
- "150", B150,
- "200", B200,
- "300", B300,
- "600", B600,
- "1200", B1200,
- "1800", B1800,
- "2400", B2400,
- "4800", B4800,
- "9600", B9600,
- "19200", B19200,
- "38400", B38400,
"exta", B19200,
"extb", B38400,
-#ifdef B57600
- "57600", B57600,
-#endif
-#ifdef B115200
- "115200", B115200,
-#endif
NULL
};
@@ -257,6 +236,7 @@ baudrate(rate)
char *rate;
{
SPEEDS *sp;
+ speed_t speed;
/* The baudrate number can be preceded by a 'B', which is ignored. */
if (*rate == 'B')
@@ -265,6 +245,8 @@ baudrate(rate)
for (sp = speeds; sp->string; ++sp)
if (!strcasecmp(rate, sp->string))
return (sp->speed);
- err("unknown baud rate %s", rate);
- /* NOTREACHED */
+ speed = atol(rate);
+ if (speed == 0)
+ err("unknown baud rate %s", rate);
+ return speed;
}