summaryrefslogtreecommitdiffstats
path: root/c/src/exec/libcsupport
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-09-21 00:01:26 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-09-21 00:01:26 +0000
commit30ba7529f1e58ba2be610a0c2581fa0f3fc23ab3 (patch)
tree831043f8fd6f3be8870567f046dedf82ef017f2d /c/src/exec/libcsupport
parentPatch from Eric Valette <valette@crf.canon.fr>: (diff)
downloadrtems-30ba7529f1e58ba2be610a0c2581fa0f3fc23ab3.tar.bz2
Patch from Eric Norum:
I fixed the problems noted by Victor Vengerov. 1) Fix typo in cfsetispeed(). 2) In rtems_termios_open, ensure that args->iop->data1 is set before calling device-specific open routine.
Diffstat (limited to 'c/src/exec/libcsupport')
-rw-r--r--c/src/exec/libcsupport/src/termios.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/c/src/exec/libcsupport/src/termios.c b/c/src/exec/libcsupport/src/termios.c
index f6b5652e57..f3637d37e3 100644
--- a/c/src/exec/libcsupport/src/termios.c
+++ b/c/src/exec/libcsupport/src/termios.c
@@ -286,19 +286,14 @@ rtems_termios_open (
tty->termios.c_cc[VLNEXT] = '\026';
/*
- * Device-specific open
- */
- if (tty->device.firstOpen)
- (*tty->device.firstOpen)(major, minor, arg);
-
- /*
* Bump name characer
*/
if (c++ == 'z')
c = 'a';
}
- tty->refcount++;
args->iop->data1 = tty;
+ if (!tty->refcount++ && tty->device.firstOpen)
+ (*tty->device.firstOpen)(major, minor, arg);
rtems_semaphore_release (ttyMutex);
return RTEMS_SUCCESSFUL;
}