This uses new functionality of libdbuspolicy: using client's pool and fd.
This way libdbuspolicy doesn't have to create its own connection,
and what is more important it doesn't have to create its own 1MB pool.
This is at the cost of using client's pool for receiving responses
to ioctl(KDBUS_CMD_GET_CONN_INFO), which are small.
Change-Id: I183a91196fead179a9fba22fa6418680305d3558
dbus_uint64_t flags;
#ifdef LIBDBUSPOLICY
- void *policy = dbuspolicy1_init (_kdbus_get_path(transport->kdbus));
+ void *policy = dbuspolicy1_init_shared (_kdbus_get_path(transport->kdbus),
+ _kdbus_get_fd(transport->kdbus));
if (NULL == policy)
{
dbus_set_error (error,
return FALSE;
}
+#ifdef LIBDBUSPOLICY
+ dbuspolicy1_init_set_pool (transport->policy, _kdbus_get_pool(transport->kdbus));
+#endif
+
transport->my_DBus_unique_name = create_unique_name_from_unique_id (_kdbus_get_id (transport->kdbus));
if (NULL == transport->my_DBus_unique_name)
{
else
ret = 0;
- } /* id DBUS_INTERFACE_DBUS */
+ } /* if DBUS_INTERFACE_DBUS */
} /* if DBUS_SERVICE_DBUS */
return ret;
return 0;
}
+void *
+_kdbus_get_pool (kdbus_t *kdbus)
+{
+ return kdbus->mmap_ptr;
+}
+
const char *
_kdbus_get_path (kdbus_t *kdbus)
{
int _kdbus_open (kdbus_t *kdbus);
int _kdbus_close (kdbus_t *kdbus);
+void *_kdbus_get_pool (kdbus_t *kdbus);
const char *_kdbus_get_path (kdbus_t *kdbus);
int _kdbus_get_fd (kdbus_t *kdbus);
__u64 _kdbus_get_id (kdbus_t *kdbus);