From 2a8713aa54a00563328714390601e0433085aca0 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 10 Jun 2013 14:10:49 +0200 Subject: termios: Avoid second return path --- cpukit/libcsupport/src/termios.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c index de852790a0..20243cadbc 100644 --- a/cpukit/libcsupport/src/termios.c +++ b/cpukit/libcsupport/src/termios.c @@ -1322,20 +1322,19 @@ rtems_termios_refill_transmitter (struct rtems_termios_tty *tty) rtems_interrupt_enable(level); nToSend = 1; - } else { - if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) { + } else if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) { + /* + * buffer was empty + */ + if (tty->rawOutBufState == rob_wait) { /* - * buffer was empty + * this should never happen... */ - if (tty->rawOutBufState == rob_wait) { - /* - * this should never happen... - */ - rtems_semaphore_release (tty->rawOutBuf.Semaphore); - } - return 0; + rtems_semaphore_release (tty->rawOutBuf.Semaphore); } + nToSend = 0; + } else { rtems_interrupt_disable(level); len = tty->t_dqlen; tty->t_dqlen = 0; -- cgit v1.2.3