* [PATCH] List with UUIDs per-adapter should be sorted
@ 2010-04-08 21:35 Francisco Alecrim
2010-04-11 22:46 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Francisco Alecrim @ 2010-04-08 21:35 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Francisco Alecrim
---
src/adapter.c | 5 +++--
src/sdpd-database.c | 2 +-
src/sdpd.h | 1 +
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index 8fc47b9..c174793 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1081,8 +1081,9 @@ static void adapter_service_ins_rem(const bdaddr_t *bdaddr, void *rec,
adapter = adapters->data;
if (insert == TRUE)
- adapter->services = sdp_list_append(adapter->services,
- rec);
+ adapter->services = sdp_list_insert_sorted(
+ adapter->services, rec,
+ record_sort);
else
adapter->services = sdp_list_remove(adapter->services,
rec);
diff --git a/src/sdpd-database.c b/src/sdpd-database.c
index 224a4e7..263b16e 100644
--- a/src/sdpd-database.c
+++ b/src/sdpd-database.c
@@ -55,7 +55,7 @@ typedef struct {
* The service repository is a linked list in sorted order
* and the service record handle is the sort key
*/
-static int record_sort(const void *r1, const void *r2)
+int record_sort(const void *r1, const void *r2)
{
const sdp_record_t *rec1 = (const sdp_record_t *) r1;
const sdp_record_t *rec2 = (const sdp_record_t *) r2;
diff --git a/src/sdpd.h b/src/sdpd.h
index 1f0a229..ce189ca 100644
--- a/src/sdpd.h
+++ b/src/sdpd.h
@@ -70,6 +70,7 @@ sdp_buf_t *sdp_get_cached_rsp(sdp_cont_state_t *cstate);
void sdp_cstate_cache_init(void);
void sdp_cstate_clean_buf(void);
+int record_sort(const void *r1, const void *r2);
void sdp_svcdb_reset(void);
void sdp_svcdb_collect_all(int sock);
void sdp_svcdb_set_collectable(sdp_record_t *rec, int sock);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] List with UUIDs per-adapter should be sorted
2010-04-08 21:35 [PATCH] List with UUIDs per-adapter should be sorted Francisco Alecrim
@ 2010-04-11 22:46 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2010-04-11 22:46 UTC (permalink / raw)
To: Francisco Alecrim; +Cc: linux-bluetooth
Hi Alecrim,
On Thu, Apr 08, 2010, Francisco Alecrim wrote:
> ---
> src/adapter.c | 5 +++--
> src/sdpd-database.c | 2 +-
> src/sdpd.h | 1 +
> 3 files changed, 5 insertions(+), 3 deletions(-)
This patch is now upstream. Thanks.
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-11 22:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-08 21:35 [PATCH] List with UUIDs per-adapter should be sorted Francisco Alecrim
2010-04-11 22:46 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).