diff options
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/libcsupport/src/termios.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c index f6b5652e57..f3637d37e3 100644 --- a/cpukit/libcsupport/src/termios.c +++ b/cpukit/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; } |