diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-08-05 23:36:21 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-08-05 23:36:21 +0000 |
commit | 044b16f4e9ae773187f4fee8a9a0a54f9a51f13f (patch) | |
tree | 58bc41e16535e0d0f61d51e6af15ce4128864fc9 /termios | |
parent | c59a94711c6a9d38811b828863076f39000831b4 (diff) |
update for 2.0.5pre1
Diffstat (limited to 'termios')
-rw-r--r-- | termios/cfsetspeed.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/termios/cfsetspeed.c b/termios/cfsetspeed.c index da31073ac2..b3c8aa3f42 100644 --- a/termios/cfsetspeed.c +++ b/termios/cfsetspeed.c @@ -107,13 +107,19 @@ cfsetspeed (struct termios *termios_p, speed_t speed) { size_t cnt; - for (cnt = 0; cnt < sizeof (speeds); ++cnt) - if (speed == speeds[cnt].value) + for (cnt = 0; cnt < sizeof (speeds) / sizeof (speeds[0]); ++cnt) + if (speed == speeds[cnt].internal) { cfsetispeed (termios_p, speed); cfsetospeed (termios_p, speed); return; } + else if (speed == speeds[cnt].value) + { + cfsetispeed (termios_p, speeds[cnt].internal); + cfsetospeed (termios_p, speeds[cnt].internal); + return; + } __set_errno (EINVAL); } |