static int deviced_main(int argc, char **argv)
{
int ret;
+ dbus_handle_h handle = NULL;
mainloop = g_main_loop_new(NULL, FALSE);
if (ret)
return 0;
- if (!dbus_handle_init(G_BUS_TYPE_SYSTEM, DEVICED_BUS_NAME, deviced_dbus_name_acquired, NULL)) {
- _E("failed to init dbus connection");
- }
+ handle = dbus_handle_get_connection(G_BUS_TYPE_SYSTEM, FALSE);
+ if (!handle)
+ _E("Fail to get dbus connection");
+
devices_init(NULL);
+ ret = dbus_handle_request_bus_name(handle, DEVICED_BUS_NAME, deviced_dbus_name_acquired, NULL);
+ if (ret <= 0) {
+ _E("Fail to request bus name");
+ dbus_handle_check_owner_name(NULL, DEVICED_BUS_NAME);
+ }
+
signal(SIGTERM, sig_quit);
signal(SIGUSR1, sig_usr1);