Patchwork [RFC,2/5] hvc_console: Add tty driver flag TTY_DRIVER_RESET_TERMIOS

login
register
mail settings
Submitter Hendrik Brueckner
Date Oct. 14, 2008, 9:12 a.m.
Message ID <20081014091413.003841094@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/4449/
State Accepted
Commit 56ce9e2b2463b3b257098aa966586701d9967f1e
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Hendrik Brueckner - Oct. 14, 2008, 9:12 a.m.
From: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>

After a tty hangup() or close() operation, processes might not reset the
termio settings to a sane state. In order to reset the termios to its
default settings the tty driver flag TTY_DRIVER_RESET_TERMIOS has been added.

TTY driver flag description from include/linux/tty_driver.h:
	TTY_DRIVER_RESET_TERMIOS --- requests the tty layer to reset the
	  termios setting when the last process has closed the device.
	  Used for PTY's, in particular.


Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
---
 drivers/char/hvc_console.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -796,7 +796,7 @@  static int hvc_init(void)
 	drv->minor_start = HVC_MINOR;
 	drv->type = TTY_DRIVER_TYPE_SYSTEM;
 	drv->init_termios = tty_std_termios;
-	drv->flags = TTY_DRIVER_REAL_RAW;
+	drv->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
 	tty_set_operations(drv, &hvc_ops);
 
 	/* Always start the kthread because there can be hotplug vty adapters