summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/shared/ChangeLog8
-rw-r--r--c/src/lib/libbsp/shared/console.c13
2 files changed, 17 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/shared/ChangeLog b/c/src/lib/libbsp/shared/ChangeLog
index 3218f4b7db..b79628c8c1 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.
+
2005-04-15 Jennifer Averett <jennifer.averett@oarcorp.com>
PR 779/bsp
diff --git a/c/src/lib/libbsp/shared/console.c b/c/src/lib/libbsp/shared/console.c
index c897544a79..e294fc1714 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);