diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-07-17 22:34:54 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-07-17 22:34:54 +0000 |
commit | 4555bc1eb585117b77bc2e29022d43ddc2da797f (patch) | |
tree | c425f8762f8ce35d0f278d721d45eaeb633f4401 /cpukit/libcsupport | |
parent | Regenerated. (diff) | |
download | rtems-4555bc1eb585117b77bc2e29022d43ddc2da797f.tar.bz2 |
Initialized tty->refcount to 0. When (for whatever reason) malloc()
returned a buffer which was not zero-filled, the reference count
was not correct. When the application exitted, the "lastClose"
handler was not being called to flush the output. This problem
had manifested itself on a variety of platforms.
The function rtems_termios_dequeue_characters() incorrectly incremented
the buffer pointers when it was invoked and there were no characters
in the ring buffer. This problem had also manifested itself on a
variety of platforms. The symptom was a strange repeating of the
data in the transmitter buffer when the transmitter serial device
was supposed to go idle.
Diffstat (limited to 'cpukit/libcsupport')
-rw-r--r-- | cpukit/libcsupport/src/termios.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c index 2a3bfe4fd1..fef2fce5ae 100644 --- a/cpukit/libcsupport/src/termios.c +++ b/cpukit/libcsupport/src/termios.c @@ -219,6 +219,7 @@ rtems_termios_open ( tty->minor = minor; tty->major = major; + tty->refcount = 0; /* * Set up mutex semaphores @@ -922,6 +923,8 @@ rtems_termios_dequeue_characters (void *ttyp, int len) if (tty->rawOutBufState == rob_wait) rtems_semaphore_release (tty->rawOutBufSemaphore); + if ( tty->rawOutBufHead == tty->rawOutBufTail ) + return; newTail = (tty->rawOutBufTail + len) % RAW_OUTPUT_BUFFER_SIZE; if (newTail == tty->rawOutBufHead) { /* |