diff options
author | Colin Walters <walters@verbum.org> | 2009-07-13 12:47:19 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2009-07-13 12:47:19 -0400 |
commit | 6478ec6949c6bb794237b43d03b68f80eba1288c (patch) | |
tree | 6cf13e96d9f6aa52abff418ff8a048e586a2b01b /dbus/dbus-sysdeps-unix.c | |
parent | c71403ddde230378e3beffee21a3d1fe6edc9bce (diff) |
Bug 14259 - Make session address lookup system-dependent
On some platforms such as MacOS X and Windows, we can't depend
on an environment variable to determine the address of the
session bus. Create a sysdep function dbus_lookup_session_address
which can be filled in with platform-specific code.
Diffstat (limited to 'dbus/dbus-sysdeps-unix.c')
-rw-r--r-- | dbus/dbus-sysdeps-unix.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index ad85204d..d10d48ba 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -3117,6 +3117,37 @@ _dbus_read_local_machine_uuid (DBusGUID *machine_id, #define DBUS_UNIX_STANDARD_SESSION_SERVICEDIR "/dbus-1/services" #define DBUS_UNIX_STANDARD_SYSTEM_SERVICEDIR "/dbus-1/system-services" +/** + * Determines the address of the session bus by querying a + * platform-specific method. + * + * The first parameter will be a boolean specifying whether + * or not a dynamic session lookup is supported on this platform. + * + * If supported is TRUE and the return value is #TRUE, the + * address will be appended to @p address. + * If a failure happens, returns #FALSE and sets an error in + * @p error. + * + * If supported is FALSE, ignore the return value. + * + * @param supported returns whether this method is supported + * @param address a DBusString where the address can be stored + * @param error a DBusError to store the error in case of failure + * @returns #TRUE on success, #FALSE if an error happened + */ +dbus_bool_t +_dbus_lookup_session_address (dbus_bool_t *supported, + DBusString *address, + DBusError *error) +{ + /* On non-Mac Unix platforms, if the session address isn't already + * set in DBUS_SESSION_BUS_ADDRESS environment variable, we punt and + * fall back to the autolaunch: global default; see + * init_session_address in dbus/dbus-bus.c. */ + *supported = FALSE; + return TRUE; +} /** * Returns the standard directories for a session bus to look for service |