Diff between 7155d7af192004eaf0b213d175beb1064796ea12 and 69d7d42e896e2ab6a23b62692a1011d552c42cc9

Changed Files

File Additions Deletions Status
profiles/input/device.c +4 -2 modified

Full Patch

diff --git a/profiles/input/device.c b/profiles/input/device.c
index e2ea459..d3724ed 100644
--- a/profiles/input/device.c
+++ b/profiles/input/device.c
@@ -333,8 +333,10 @@ static gboolean intr_watch_cb(GIOChannel *chan, GIOCondition cond, gpointer data
 		idev->intr_io = NULL;
 	}
 
-	/* Close control channel */
-	if (idev->ctrl_io && !(cond & G_IO_NVAL))
+	/* Close control channel if the closing of interrupt channel is not
+	 * initiated by the other party
+	 */
+	if (idev->ctrl_io && !(cond & (G_IO_NVAL | G_IO_ERR)))
 		g_io_channel_shutdown(idev->ctrl_io, TRUE, NULL);
 
 	btd_service_disconnecting_complete(idev->service, 0);