From 5285b3f4bf029f86b2e22c24428fa92315267897 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 23 Feb 2009 10:34:16 +0200 Subject: Input plugin fixes and cleanup This patch fixes all known issues caused by converting the input plugin to use BtIO. --- input/server.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'input/server.c') diff --git a/input/server.c b/input/server.c index 6d08804b..041f302c 100644 --- a/input/server.c +++ b/input/server.c @@ -89,7 +89,6 @@ static int authorize_device(const bdaddr_t *src, const bdaddr_t *dst) static void connect_event_cb(GIOChannel *chan, GError *err, gpointer data) { - int sk; uint16_t psm; bdaddr_t src, dst; GError *gerr = NULL; @@ -113,13 +112,11 @@ static void connect_event_cb(GIOChannel *chan, GError *err, gpointer data) debug("Incoming connection on PSM %d", psm); - sk = g_io_channel_unix_get_fd(chan); - - if (input_device_set_channel(&src, &dst, psm, sk) < 0) { + if (input_device_set_channel(&src, &dst, psm, chan) < 0) { /* Send unplug virtual cable to unknown devices */ if (psm == L2CAP_PSM_HIDP_CTRL) { unsigned char unplug[] = { 0x15 }; - int err; + int err, sk = g_io_channel_unix_get_fd(chan); err = write(sk, unplug, sizeof(unplug)); } g_io_channel_shutdown(chan, TRUE, NULL); -- cgit