From 35bf6758f61cbbabd53492b20fa7e92d41d80438 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Thu, 21 Nov 2013 02:11:55 +0100 Subject: [PATCH] main: Call agent_init first agent_init will register the /org/neard name and if an adapter is registered before /org/neard is registered, its parent will be "/". That happens when starting neard with an adapter already plugged in. --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 1fd76fb..a2c3a84 100644 --- a/src/main.c +++ b/src/main.c @@ -279,13 +279,13 @@ int main(int argc, char *argv[]) exit(1); } + __near_agent_init(); __near_tag_init(); __near_device_init(); __near_adapter_init(); __near_ndef_init(); __near_snep_core_init(); __near_manager_init(conn); - __near_agent_init(); __near_bluetooth_init(); __near_plugin_init(option_plugin, option_noplugin); @@ -303,7 +303,6 @@ int main(int argc, char *argv[]) __near_plugin_cleanup(); - __near_agent_cleanup(); __near_bluetooth_cleanup(); __near_manager_cleanup(); __near_ndef_cleanup(); @@ -311,6 +310,7 @@ int main(int argc, char *argv[]) __near_adapter_cleanup(); __near_device_cleanup(); __near_tag_cleanup(); + __near_agent_cleanup(); __near_netlink_cleanup(); __near_dbus_cleanup(); -- 2.7.4