summaryrefslogtreecommitdiff
path: root/cpukit/libcsupport/src/termios_baud2num.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libcsupport/src/termios_baud2num.c')
-rw-r--r--cpukit/libcsupport/src/termios_baud2num.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/cpukit/libcsupport/src/termios_baud2num.c b/cpukit/libcsupport/src/termios_baud2num.c
index 57b908ebee..e9c279aa3d 100644
--- a/cpukit/libcsupport/src/termios_baud2num.c
+++ b/cpukit/libcsupport/src/termios_baud2num.c
@@ -10,24 +10,14 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+ #include "config.h"
#endif
-#include <sys/termios.h>
#include <rtems/termiostypes.h>
-#include <rtems/assoc.h>
-extern rtems_assoc_t termios_assoc_table[];
-
-int32_t rtems_termios_baud_to_number(
- int termios_baud
-)
+rtems_termios_baud_t rtems_termios_baud_to_number(tcflag_t c_cflag)
{
- int baud;
-
- baud = rtems_assoc_local_by_remote( termios_assoc_table, termios_baud );
- if ( baud == 0 && termios_baud != 0 )
- return -1;
+ uint32_t remote_value = (uint32_t) (c_cflag & CBAUD);
- return baud;
+ return rtems_assoc_local_by_remote(rtems_termios_baud_table, remote_value);
}