diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2011-12-14 08:50:49 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2011-12-14 08:50:49 +0000 |
commit | 40f8b21ef432b5854ad09881ab8fbcbee18cf9e1 (patch) | |
tree | a6c8302378fd9d34761e915720325ae82a7dfebd /cpukit/libcsupport/src/termios_setinitialbaud.c | |
parent | Regenerate. (diff) | |
download | rtems-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_setinitialbaud.c')
-rw-r--r-- | cpukit/libcsupport/src/termios_setinitialbaud.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/cpukit/libcsupport/src/termios_setinitialbaud.c b/cpukit/libcsupport/src/termios_setinitialbaud.c index 282f5533de..4d7ec558fe 100644 --- a/cpukit/libcsupport/src/termios_setinitialbaud.c +++ b/cpukit/libcsupport/src/termios_setinitialbaud.c @@ -10,24 +10,26 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" + #include "config.h" #endif -#include <sys/termios.h> #include <rtems/termiostypes.h> -int rtems_termios_set_initial_baud( - struct rtems_termios_tty *ttyp, - int32_t baud +int rtems_termios_set_initial_baud( + struct rtems_termios_tty *tty, + rtems_termios_baud_t baud ) { - int cflags_baud; + int rv = 0; + tcflag_t c_cflag_baud = rtems_termios_number_to_baud(baud); - cflags_baud = rtems_termios_number_to_baud(baud); - if ( cflags_baud == -1 ) - return -1; + if ( c_cflag_baud == 0 ) { + tcflag_t cbaud = CBAUD; - ttyp->termios.c_cflag = (ttyp->termios.c_cflag & ~CBAUD) | cflags_baud; + tty->termios.c_cflag = (tty->termios.c_cflag & ~cbaud) | c_cflag_baud; + } else { + rv = -1; + } - return 0; + return rv; } |