19 Jun 2012 12:02
[PATCH BlueZ] input: Fix not adding watches when io channel is connected
From: Luiz Augusto von Dentz <luiz.von.dentz@...> This can leave dangling pointers in case one of the channel is never connected which cause -EALREADY to be returned by input_device_set_channel next time the device attempts to connect. --- input/device.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/input/device.c b/input/device.c index 0e3f4a9..ba27c6a 100644 --- a/input/device.c +++ b/input/device.c <at> <at> -387,6 +387,11 <at> <at> static gboolean intr_watch_cb(GIOChannel *chan, GIOCondition cond, gpointer data struct input_conn *iconn = data; struct input_device *idev = iconn->idev; gboolean connected = FALSE; + char address[18]; + + ba2str(&iconn->idev->dst, address); + + DBG("Device %s disconnected", address); /* Checking for ctrl_watch avoids a double g_io_channel_shutdown since * it's likely that ctrl_watch_cb has been queued for dispatching in <at> <at> -415,6 +420,11 <at> <at> static gboolean intr_watch_cb(GIOChannel *chan, GIOCondition cond, gpointer data static gboolean ctrl_watch_cb(GIOChannel *chan, GIOCondition cond, gpointer data) { struct input_conn *iconn = data; + char address[18];(Continue reading)
RSS Feed