diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2005-08-19 16:20:00 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2005-08-19 16:20:00 +0000 |
commit | 4a4c78d97f6bea5bfb5583a8ab8afc2e4fb5c594 (patch) | |
tree | b43c26ae73fb867b72920a36a8f2fd71519a92ad | |
parent | 2005-08-18 Andrew Sinclair <Andrew.Sinclair@elprotech.com> (diff) | |
download | rtems-4a4c78d97f6bea5bfb5583a8ab8afc2e4fb5c594.tar.bz2 |
2005-08-19 Cedric Aubert <cedric_aubert@yahoo.fr>
PR 577/bsps
* console.c: The console_close() method currently calls StopRemoteTx()
on all invocations. It should should be ok for last close only but
not for any others. If you open a port multiple times, you only want
to call StopRemoteTx() only as part of the last close.
-rw-r--r-- | c/src/lib/libbsp/shared/ChangeLog | 8 | ||||
-rw-r--r-- | c/src/lib/libbsp/shared/console.c | 13 |
2 files changed, 17 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/shared/ChangeLog b/c/src/lib/libbsp/shared/ChangeLog index 9aeb20e5f0..30e3f1d1a4 100644 --- a/c/src/lib/libbsp/shared/ChangeLog +++ b/c/src/lib/libbsp/shared/ChangeLog @@ -1,3 +1,11 @@ +2005-08-19 Cedric Aubert <cedric_aubert@yahoo.fr> + + PR 577/bsps + * console.c: The console_close() method currently calls StopRemoteTx() + on all invocations. It should should be ok for last close only but + not for any others. If you open a port multiple times, you only want + to call StopRemoteTx() only as part of the last close. + 2004-12-10 Ralf Corsepius <ralf.corsepius@rtems.org> PR 704/bsps. diff --git a/c/src/lib/libbsp/shared/console.c b/c/src/lib/libbsp/shared/console.c index 0f59a17231..b553ae9fed 100644 --- a/c/src/lib/libbsp/shared/console.c +++ b/c/src/lib/libbsp/shared/console.c @@ -128,10 +128,15 @@ rtems_device_driver console_close( { rtems_libio_open_close_args_t *args = arg; - if ( (args->iop->flags&LIBIO_FLAGS_READ) && - Console_Port_Tbl[minor].pDeviceFlow && - Console_Port_Tbl[minor].pDeviceFlow->deviceStopRemoteTx) { - Console_Port_Tbl[minor].pDeviceFlow->deviceStopRemoteTx(minor); + /* Get the tty refcount to determine if we need to do deviceStopRemoteTx. + * Stop only if it's the last one opened. + */ + if ( (current_tty->refcount == 1) ) { + if ( (args->iop->flags&LIBIO_FLAGS_READ) && + Console_Port_Tbl[minor].pDeviceFlow && + Console_Port_Tbl[minor].pDeviceFlow->deviceStopRemoteTx) { + Console_Port_Tbl[minor].pDeviceFlow->deviceStopRemoteTx(minor); + } } return rtems_termios_close (arg); |