Question on C code - any programmatic way of setting DBUS_BUS_SESSION address?
Olivier Hochreutiner
olivier.hochreutiner at gmail.com
Tue Apr 22 23:04:47 PDT 2008
> While in dbus_bus.c (v1.1.20) I could see method like internal_bus_get,
> which has this code line:
>
> address = bus_connection_addresses[address_type];
>
> I don't see any way of setting that address programmatically and without
> touching environment settings. Is it possible?
>
> Why not have extended version of dbus_bus_get:
>
> Instead of:
>
> dbus_bus_get (DBusBusType type,
> DBusError *error)
>
> Have this:
>
> dbus_bus_get (DBusBusType type,
> const char* address,
> DBusError *error)
>
> And then reflect to that in internal_bus_get accordingly?
>
> What do you think?
I believe you can just do:
putenv("DBUS_SESSION_BUS_ADDRESS=<address>");
before calling dbus_bus_get() ?
Anyway I don't believe D-Bus mainainers are likely to make an API change...
Best,
Olivier
More information about the dbus
mailing list