+ evmgr = afb_daemon_get_evmgr(itf->daemon);
+
+ /* creates the sbus for session */
+ pollmgr = afb_daemon_get_pollmgr(itf->daemon);
+ sbusitf.wait = pollmgr.itf->wait;
+ sbusitf.open = pollmgr.itf->open;
+ sbusitf.on_readable = pollmgr.itf->on_readable;
+ sbusitf.on_writable = pollmgr.itf->on_writable;
+ sbusitf.on_hangup = pollmgr.itf->on_hangup;
+ sbusitf.close = pollmgr.itf->close;
+ sbus = sbus_session(&sbusitf, pollmgr.closure);
+ if (sbus == NULL) {
+ fprintf(stderr, "ERROR: %s:%d: can't connect to DBUS session\n", __FILE__, __LINE__);
+ return NULL;
+ }
+
+ /* creates the jbus for accessing afm-user-daemon */
+ jbus = create_jbus(sbus, "/org/AGL/afm/user");
+ if (jbus == NULL) {
+ sbus_unref(sbus);
+ return NULL;
+ }
+
+ /* records the signal handler */
+ rc = jbus_on_signal_s(jbus, _changed_, application_list_changed, NULL);
+ if (rc < 0) {
+ jbus_unref(jbus);
+ return NULL;
+ }