diff options
author | Gedare Bloom <gedare@rtems.org> | 2013-09-05 14:34:32 -0400 |
---|---|---|
committer | Gedare Bloom <gedare@rtems.org> | 2013-09-05 14:34:32 -0400 |
commit | a803e04df6d90cdf9540f721d7edd31936610e8a (patch) | |
tree | 8db0dcf57df778e386d603d91f470e9876af55cc /cpukit | |
parent | flashdisk: swap arguments to checksum helper (diff) | |
download | rtems-a803e04df6d90cdf9540f721d7edd31936610e8a.tar.bz2 |
termios: check return value from semaphore obtain/release
Raise a fatal error in case of failure.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/libcsupport/src/termios.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c index 976c376281..c462ce6609 100644 --- a/cpukit/libcsupport/src/termios.c +++ b/cpukit/libcsupport/src/termios.c @@ -970,9 +970,14 @@ siproc (unsigned char c, struct rtems_termios_tty *tty) * Obtain output semaphore if character will be echoed */ if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) { - rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); + rtems_status_code sc; + sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT); + if (sc != RTEMS_SUCCESSFUL) + rtems_fatal_error_occurred (sc); i = iproc (c, tty); - rtems_semaphore_release (tty->osem); + sc = rtems_semaphore_release (tty->osem); + if (sc != RTEMS_SUCCESSFUL) + rtems_fatal_error_occurred (sc); } else { i = iproc (c, tty); |