summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--serial/manager.c8
1 files changed, 8 insertions, 0 deletions
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);