Obtain output semaphore before drain output during close to prevent an infinite output drain loop

This commit is contained in:
Thomas Doerfler
2009-11-30 13:23:58 +00:00
parent 5ad790ffbb
commit 42836e3f85
2 changed files with 9 additions and 0 deletions

View File

@@ -29,6 +29,11 @@
* score/include/rtems/score/chain.h, sapi/include/rtems/chain.h: Added
defines for initialization of empty chains.
2009-11-30 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/termios.c: Obtain output semaphore before drain
output during close to prevent an infinite output drain loop.
2009-11-30 Sebastian Huber <sebastian.huber@embedded-brains.de>
* rtems/include/rtems/rtems/timer.h: Added timer server control block

View File

@@ -374,6 +374,10 @@ rtems_termios_close (void *arg)
/*
* default: just flush output buffer
*/
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL) {
rtems_fatal_error_occurred (sc);
}
drainOutput (tty);
}