From 15974e3190a05a68923bb40dfab457781b18e397 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 25 Sep 2006 15:19:58 +0000 Subject: Keep watching the bonding IO channel after the connection has been created --- hcid/dbus-adapter.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c index 7986b028..c7f11d5b 100644 --- a/hcid/dbus-adapter.c +++ b/hcid/dbus-adapter.c @@ -1808,6 +1808,12 @@ static gboolean create_bonding_conn_complete(GIOChannel *io, GIOCondition cond, goto cleanup; } + if (cond & G_IO_HUP & G_IO_ERR) { + debug("Hangup or error on bonding IO channel"); + error_failed(pdata->bonding->conn, pdata->bonding->rq, EIO); + goto failed; + } + sk = g_io_channel_unix_get_fd(io); len = sizeof(ret); @@ -1867,7 +1873,9 @@ static gboolean create_bonding_conn_complete(GIOChannel *io, GIOCondition cond, hci_close_dev(dd); - pdata->bonding->io_id = 0; + pdata->bonding->io_id = g_io_add_watch(io, G_IO_NVAL | G_IO_HUP | G_IO_ERR, + (GIOFunc) create_bonding_conn_complete, + pdata); return FALSE; -- cgit