summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/termios_num2baud.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2011-12-14 08:50:49 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2011-12-14 08:50:49 +0000
commit40f8b21ef432b5854ad09881ab8fbcbee18cf9e1 (patch)
treea6c8302378fd9d34761e915720325ae82a7dfebd /cpukit/libcsupport/src/termios_num2baud.c
parentRegenerate. (diff)
downloadrtems-40f8b21ef432b5854ad09881ab8fbcbee18cf9e1.tar.bz2
2011-12-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/include/rtems/termiostypes.h, libcsupport/src/termios_baud2num.c, libcsupport/src/termios_baudtable.c, libcsupport/src/termios_num2baud.c, libcsupport/src/termios_setinitialbaud.c: Added const qualifier to baud associations. Fixed integer types.
Diffstat (limited to 'cpukit/libcsupport/src/termios_num2baud.c')
-rw-r--r--cpukit/libcsupport/src/termios_num2baud.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/cpukit/libcsupport/src/termios_num2baud.c b/cpukit/libcsupport/src/termios_num2baud.c
index 3725609135..3d6f0038f0 100644
--- a/cpukit/libcsupport/src/termios_num2baud.c
+++ b/cpukit/libcsupport/src/termios_num2baud.c
@@ -10,23 +10,21 @@
*/
#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[];
-
-int rtems_termios_number_to_baud(
- int32_t baud
-)
+tcflag_t rtems_termios_number_to_baud(rtems_termios_baud_t baud)
{
- int termios_baud;
+ uint32_t remote_value = rtems_assoc_remote_by_local(
+ rtems_termios_baud_table,
+ baud
+ );
+
+ if (remote_value == 0) {
+ remote_value = B0;
+ }
- termios_baud = rtems_assoc_remote_by_local( termios_assoc_table, baud );
- if ( termios_baud == 0 && baud != 0 )
- return -1;
- return termios_baud;
+ return (tcflag_t) remote_value;
}