diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2008-03-12 15:07:07 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2008-03-12 15:07:07 +0000 |
commit | 75add5651e5dbc49c9c144acceac7e2c32d9bd16 (patch) | |
tree | 98490b790c08fa7dbbb341a4ca23814f84ed0960 /hcid/device.c | |
parent | 48cd630295b689720a564ab8a03c0473930c63d6 (diff) |
Added RemoveDevice
Diffstat (limited to 'hcid/device.c')
-rw-r--r-- | hcid/device.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/hcid/device.c b/hcid/device.c index 49b3ab84..3f4e5ba4 100644 --- a/hcid/device.c +++ b/hcid/device.c @@ -934,6 +934,21 @@ const gchar *device_create(struct adapter *adapter, return device->path; } +static gint device_path_cmp(const struct device *device, const char *path) +{ + return strcmp(device->path, path); +} + void device_remove(const gchar *path) { + GSList *l; + + l = g_slist_find_custom(device_list, path, + (GCompareFunc) device_path_cmp); + if (!l) + return; + + dbus_connection_destroy_object_path(connection, path); + + device_list = g_slist_remove(device_list, l->data); } |