summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-06-09 21:13:58 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-06-09 21:13:58 +0000
commit1f7fe4eccf979527380b4ae9a1c6d7aa0bb8674e (patch)
treec262ce9ecccde1db244f29799ff7909ee45ad435 /hcid
parentf59e2e8ec01d6e725922d2cafbf17fa81cd4c669 (diff)
Remove use of g_dbus_unregister_all_interfaces.
Diffstat (limited to 'hcid')
-rw-r--r--hcid/adapter.c5
-rw-r--r--hcid/adapter.h2
-rw-r--r--hcid/dbus-hci.c14
-rw-r--r--hcid/dbus-security.c5
-rw-r--r--hcid/dbus-security.h1
5 files changed, 24 insertions, 3 deletions
diff --git a/hcid/adapter.c b/hcid/adapter.c
index 9662559b..f3472256 100644
--- a/hcid/adapter.c
+++ b/hcid/adapter.c
@@ -4369,6 +4369,11 @@ dbus_bool_t adapter_init(DBusConnection *conn,
NULL, adapter, NULL);
}
+dbus_bool_t adapter_cleanup(DBusConnection *conn, const char *path)
+{
+ return g_dbus_unregister_interface(conn, path, ADAPTER_INTERFACE);
+}
+
const char *major_class_str(uint32_t class)
{
uint8_t index = (class >> 8) & 0x1F;
diff --git a/hcid/adapter.h b/hcid/adapter.h
index 844a66f4..ef579832 100644
--- a/hcid/adapter.h
+++ b/hcid/adapter.h
@@ -126,6 +126,8 @@ struct adapter {
dbus_bool_t adapter_init(DBusConnection *conn,
const char *path, struct adapter *adapter);
+dbus_bool_t adapter_cleanup(DBusConnection *conn, const char *path);
+
struct device *adapter_get_device(DBusConnection *conn,
struct adapter *adapter, const gchar *address);
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index d6fc0e95..20854087 100644
--- a/hcid/dbus-hci.c
+++ b/hcid/dbus-hci.c
@@ -494,14 +494,22 @@ int unregister_adapter_path(const char *path)
g_free(adapter);
unreg:
- if (!g_dbus_unregister_all_interfaces(connection, path)) {
- error("D-Bus failed to unregister %s object", path);
+ if (!adapter_cleanup(connection, path)) {
+ error("Failed to unregister adapter interface on %s object",
+ path);
+ return -1;
+ }
+
+ if (!security_cleanup(connection, path)) {
+ error("Failed to unregister security interface on %s object",
+ path);
return -1;
}
if (hcid_dbus_use_experimental()) {
const char *ptr = path + ADAPTER_PATH_INDEX;
- g_dbus_unregister_all_interfaces(connection, ptr);
+
+ adapter_cleanup(connection, ptr);
}
return 0;
diff --git a/hcid/dbus-security.c b/hcid/dbus-security.c
index 94f451e9..146c1190 100644
--- a/hcid/dbus-security.c
+++ b/hcid/dbus-security.c
@@ -594,6 +594,11 @@ dbus_bool_t security_init(DBusConnection *conn, const char *path)
security_methods, NULL, NULL, NULL, NULL);
}
+dbus_bool_t security_cleanup(DBusConnection *conn, const char *path)
+{
+ return g_dbus_unregister_interface(conn, path, SECURITY_INTERFACE);
+}
+
static DBusPendingCall *agent_request(const char *path, bdaddr_t *bda,
struct passkey_agent *agent,
dbus_bool_t numeric, int old_if)
diff --git a/hcid/dbus-security.h b/hcid/dbus-security.h
index 38c2d519..cf54a5a8 100644
--- a/hcid/dbus-security.h
+++ b/hcid/dbus-security.h
@@ -25,6 +25,7 @@
#define SECURITY_INTERFACE "org.bluez.Security"
dbus_bool_t security_init(DBusConnection *conn, const char *path);
+dbus_bool_t security_cleanup(DBusConnection *conn, const char *path);
int handle_passkey_request_old(DBusConnection *conn, int dev,
struct adapter *adapter,