From 1759dbb30dd2b621ca0a094643dd90febd4a67d1 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 20 Aug 2009 11:25:56 -0300 Subject: [PATCH] obexd: Fix bluetooth initialization. Wait for g_dbus_add_service_watch to check for bluetoothd and only then proceed with BtIO and record registration. --- obexd/src/bluetooth.c | 9 --------- obexd/src/manager.c | 13 ------------- 2 files changed, 22 deletions(-) diff --git a/obexd/src/bluetooth.c b/obexd/src/bluetooth.c index 677c1d91c..9cf2acfd6 100644 --- a/obexd/src/bluetooth.c +++ b/obexd/src/bluetooth.c @@ -143,7 +143,6 @@ static gint server_register(guint16 service, const gchar *name, guint8 channel, const gchar *capability) { struct server *server; - int err; server = g_new0(struct server, 1); server->services = service; @@ -157,16 +156,8 @@ static gint server_register(guint16 service, const gchar *name, guint8 channel, server->rx_mtu = BT_RX_MTU; server->tx_mtu = BT_TX_MTU; - err = server_start(server); - if (err < 0) { - server_free(server); - return err; - } - servers = g_slist_append(servers, server); - register_record(server, NULL); - return 0; } diff --git a/obexd/src/manager.c b/obexd/src/manager.c index 14d2e46d6..24ed3dbe4 100644 --- a/obexd/src/manager.c +++ b/obexd/src/manager.c @@ -672,17 +672,6 @@ static DBusPendingCall *find_adapter(const char *pattern, return call; } -static gboolean find_adapter_any_idle(gpointer user_data) -{ - DBusPendingCall *call; - - call = find_adapter("any", find_adapter_any_reply, NULL); - if (call) - dbus_pending_call_unref(call); - - return FALSE; -} - static void name_acquired(DBusConnection *conn, void *user_data) { DBusPendingCall *call; @@ -728,8 +717,6 @@ gboolean manager_init(void) listener_id = g_dbus_add_service_watch(system_conn, "org.bluez", name_acquired, name_released, NULL, NULL); - g_idle_add(find_adapter_any_idle, NULL); - return g_dbus_register_interface(connection, OPENOBEX_MANAGER_PATH, OPENOBEX_MANAGER_INTERFACE, manager_methods, manager_signals, NULL, -- 2.47.3