summaryrefslogtreecommitdiffstats
path: root/serial/manager.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-08-15 14:02:10 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-08-15 14:02:10 +0000
commit74e5259eb027bd0eaef50004ffe62de28d77e77b (patch)
tree91edba2e0ed6d2e0f25b1f4a279f6231ab652a04 /serial/manager.c
parentb8769c4814ad301b9ee409847b9df12085e69f59 (diff)
serial: restore the initial TTY configuration when the proxy is unregistered
Diffstat (limited to 'serial/manager.c')
-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);