Diff between 86980984dd9ddeffe8124d3b0193f5a2d4ad3605 and 974bb2dca2d91b2c46e55b1fb00c095adfd0f2f1

Changed Files

File Additions Deletions Status
src/attrib-server.c +5 -5 modified
src/attrib-server.h +1 -1 modified

Full Patch

diff --git a/src/attrib-server.c b/src/attrib-server.c
index e01235f..56cd909 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -1371,19 +1371,19 @@ int attrib_db_update(struct btd_adapter *adapter, uint16_t handle,
 	return 0;
 }
 
-int attrib_db_del(uint16_t handle)
+int attrib_db_del(struct btd_adapter *adapter, uint16_t handle)
 {
 	struct gatt_server *server;
 	struct attribute *a;
 	GSList *l;
 	guint h = handle;
 
-	DBG("Deprecated function!");
-
-	server = get_default_gatt_server();
-	if (server == NULL)
+	l = g_slist_find_custom(servers, adapter, adapter_cmp);
+	if (l == NULL)
 		return -ENOENT;
 
+	server = l->data;
+
 	DBG("handle=0x%04x", handle);
 
 	l = g_slist_find_custom(server->database, GUINT_TO_POINTER(h),
diff --git a/src/attrib-server.h b/src/attrib-server.h
index fb7f285..becb3a8 100644
--- a/src/attrib-server.h
+++ b/src/attrib-server.h
@@ -29,7 +29,7 @@ struct attribute *attrib_db_add(struct btd_adapter *adapter, uint16_t handle,
 int attrib_db_update(struct btd_adapter *adapter, uint16_t handle,
 					bt_uuid_t *uuid, const uint8_t *value,
 					int len, struct attribute **attr);
-int attrib_db_del(uint16_t handle);
+int attrib_db_del(struct btd_adapter *adapter, uint16_t handle);
 int attrib_gap_set(struct btd_adapter *adapter, uint16_t uuid,
 						const uint8_t *value, int len);
 uint32_t attrib_create_sdp(uint16_t handle, const char *name);