summaryrefslogtreecommitdiffstats
path: root/c/src/exec/libcsupport
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-07-17 22:34:54 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-07-17 22:34:54 +0000
commit4555bc1eb585117b77bc2e29022d43ddc2da797f (patch)
treec425f8762f8ce35d0f278d721d45eaeb633f4401 /c/src/exec/libcsupport
parentRegenerated. (diff)
downloadrtems-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 'c/src/exec/libcsupport')
-rw-r--r--c/src/exec/libcsupport/src/termios.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/c/src/exec/libcsupport/src/termios.c b/c/src/exec/libcsupport/src/termios.c
index 2a3bfe4fd1..fef2fce5ae 100644
--- a/c/src/exec/libcsupport/src/termios.c
+++ b/c/src/exec/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) {
/*