summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-01-20 23:17:46 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-01-20 23:17:46 +0000
commita0feeed071ed394220a67b46dd770761dfb36f47 (patch)
treed3c2b3528bdb1f9e56a5f06595a14f7965c2be00
parentac4b077088a5580a53bf272168cbc798afcc7218 (diff)
Remove the global D-Bus connection variable
-rw-r--r--hcid/dbus-common.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hcid/dbus-common.c b/hcid/dbus-common.c
index 3aa503bb..893e7970 100644
--- a/hcid/dbus-common.c
+++ b/hcid/dbus-common.c
@@ -66,8 +66,6 @@
#define MAX_CONN_NUMBER 10
#define RECONNECT_RETRY_TIMEOUT 5000
-static DBusConnection *conn = NULL;
-
static sdp_session_t *sess = NULL;
static int experimental = 0;
@@ -251,13 +249,16 @@ int hcid_dbus_use_experimental(void)
static gboolean system_bus_reconnect(void *data)
{
+ DBusConnection *conn = get_dbus_connection();
struct hci_dev_list_req *dl = NULL;
struct hci_dev_req *dr;
int sk, i;
gboolean ret_val = TRUE;
- if (dbus_connection_get_is_connected(conn))
- return FALSE;
+ if (conn) {
+ if (dbus_connection_get_is_connected(conn))
+ return FALSE;
+ }
if (hcid_dbus_init() < 0)
return TRUE;