summaryrefslogtreecommitdiffstats
path: root/sdpd
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-04-25 22:14:22 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-04-25 22:14:22 +0000
commit44847d5dfc0eebba1cebad1fbc89895901bfe09b (patch)
tree8021bc6f212c44e978f1c08f84eb5f6b02a6f186 /sdpd
parenteefb64d927b48d2de2e100b1f7ee715bf86bbb57 (diff)
Added UpdateServiceRecord
Diffstat (limited to 'sdpd')
-rw-r--r--sdpd/sdpd.h2
-rw-r--r--sdpd/service.c15
2 files changed, 10 insertions, 7 deletions
diff --git a/sdpd/sdpd.h b/sdpd/sdpd.h
index 13aa2c74..31f3b645 100644
--- a/sdpd/sdpd.h
+++ b/sdpd/sdpd.h
@@ -86,4 +86,4 @@ int start_sdp_server(uint16_t mtu, const char *did, uint32_t flags);
void stop_sdp_server(void);
int add_record_to_server(sdp_record_t *rec);
-void remove_record_from_server(uint32_t handle);
+int remove_record_from_server(uint32_t handle);
diff --git a/sdpd/service.c b/sdpd/service.c
index 8c8c3a73..e469d841 100644
--- a/sdpd/service.c
+++ b/sdpd/service.c
@@ -297,19 +297,22 @@ int add_record_to_server(sdp_record_t *rec)
return 0;
}
-void remove_record_from_server(uint32_t handle)
+int remove_record_from_server(uint32_t handle)
{
sdp_record_t *rec;
debug("Removing record with handle 0x%05x", handle);
rec = sdp_record_find(handle);
- if (rec) {
- if (sdp_record_remove(handle) == 0)
- update_db_timestamp();
+ if (!rec)
+ return -ENOENT;
- sdp_record_free(rec);
- }
+ if (sdp_record_remove(handle) == 0)
+ update_db_timestamp();
+
+ sdp_record_free(rec);
+
+ return 0;
}
// FIXME: refactor for server-side