From 74e5259eb027bd0eaef50004ffe62de28d77e77b Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 15 Aug 2007 14:02:10 +0000 Subject: serial: restore the initial TTY configuration when the proxy is unregistered --- serial/manager.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'serial/manager.c') diff --git a/serial/manager.c b/serial/manager.c index 8703606a..1cf4e083 100644 --- a/serial/manager.c +++ b/serial/manager.c @@ -1343,9 +1343,17 @@ static DBusMethodVTable proxy_methods[] = { static void proxy_handler_unregister(DBusConnection *conn, void *data) { struct proxy *prx = data; + int sk; info("Unregistered proxy: %s", prx->tty); + /* Restore the initial TTY configuration */ + sk = open(prx->tty, O_RDWR | O_NOCTTY); + if (sk) { + tcsetattr(sk, TCSAFLUSH, &prx->sys_ti); + close(sk); + } + if (prx->listen_watch) g_source_remove(prx->listen_watch); -- cgit