{
int ret;
guint timer;
+ dbus_handle_h handle = NULL;
loop = g_main_loop_new(NULL, TRUE);
if (!loop) {
return -ENOMEM;
}
- if (!dbus_handle_init(G_BUS_TYPE_SYSTEM, STORAGED_BUS_NAME, NULL, NULL)) {
- _E("Failed to set dbus connection (%s)", STORAGED_BUS_NAME);
- return 0;
- }
+ handle = dbus_handle_get_connection(G_BUS_TYPE_SYSTEM, FALSE);
+ if (!handle)
+ _E("Fail to get dbus connection");;
modules_init(NULL);
+
+ ret = dbus_handle_request_bus_name(handle, STORAGED_BUS_NAME, NULL, NULL);
+ if (ret <= 0) {
+ _E("Fail to request bus name");
+ dbush_handle_check_owner_name(NULL, STORAGED_BUS_NAME);
+ }
+
signal(SIGTERM, sig_quit);
signal(SIGUSR1, sig_usr1);