summaryrefslogtreecommitdiffstats
path: root/input/manager.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-03-19 17:49:20 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-03-19 17:49:20 +0000
commitab0791e294f317f970e5dc288c2d9f87fd22a4e2 (patch)
tree6006b65bf8ecfc06409acf762ca1db23dde108ba /input/manager.c
parent17033a18b3ee31d14b19f52d2328a2ba80f4ce1f (diff)
input: delete the stored input date when RemoveDevice is called
Diffstat (limited to 'input/manager.c')
-rw-r--r--input/manager.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/input/manager.c b/input/manager.c
index ea34960b..2675b5cb 100644
--- a/input/manager.c
+++ b/input/manager.c
@@ -114,7 +114,7 @@ static int path_bdaddr_cmp(const char *path, const bdaddr_t *bdaddr)
struct input_device *idev;
if (!dbus_connection_get_object_path_data(connection, path,
- (void *) &idev))
+ (void *) &idev))
return -1;
if (!idev)
@@ -648,6 +648,7 @@ static DBusHandlerResult manager_remove_device(DBusConnection *conn,
DBusMessage *msg, void *data)
{
struct input_manager *mgr = data;
+ struct input_device *idev;
DBusMessage *reply;
DBusError derr;
GSList *l;
@@ -673,8 +674,10 @@ static DBusHandlerResult manager_remove_device(DBusConnection *conn,
g_free(l->data);
mgr->paths = g_slist_remove(mgr->paths, l->data);
- /* FIXME: how retrieve the destination address */
- //del_stored_device_info(&mgr->src, &idev->dst);
+ if (!dbus_connection_get_object_path_data(connection, path, (void *) &idev))
+ return err_does_not_exist(conn, msg, "Input doesn't exist");
+
+ del_stored_device_info(&mgr->src, &idev->dst);
if (input_device_unregister(conn, path) < 0) {
dbus_message_unref(reply);