summaryrefslogtreecommitdiffstats
path: root/serial
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-08-17 14:21:32 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-08-17 14:21:32 +0000
commit1f42e9d93329e035215b9ec1394941599318528a (patch)
treef06c3922440201e16e4ceacf71f8d03dbdc45047 /serial
parentab622e0de1826968a0506d47dc766a59787074bc (diff)
serial: proxy cleanup - it is not necessary apply the TTY settings at proxy registration
Diffstat (limited to 'serial')
-rw-r--r--serial/manager.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/serial/manager.c b/serial/manager.c
index 9043cc0c..15e0fca8 100644
--- a/serial/manager.c
+++ b/serial/manager.c
@@ -1577,16 +1577,14 @@ static int proxy_register(DBusConnection *conn, bdaddr_t *src, const char *path,
memset(&sys_ti, 0, sizeof(sys_ti));
tcgetattr(sk, &sys_ti);
memcpy(&prx->sys_ti, &sys_ti, sizeof(sys_ti));
- if (!ti) {
- /* Keep the current settings */
+ close(sk);
+
+ if (!ti)
+ /* Use current settings */
memcpy(&prx->proxy_ti, &sys_ti, sizeof(sys_ti));
- } else {
+ else
/* New TTY settings: user provided */
memcpy(&prx->proxy_ti, ti, sizeof(*ti));
- tcsetattr(sk, TCSANOW, ti);
- }
-
- close(sk);
if (!dbus_connection_register_interface(conn, path,
SERIAL_PROXY_INTERFACE,