test-shutdown expects a GUID in the bus address by default,
which is not available under Windows, because on this platform
an autolaunch address is provided by dbus-run-session and is
not returned by dbus-daemon.
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/59
Reviewed-by: Simon McVittie <smcv@collabora.com>
DBusConnection *connection;
char *session_addr_no_guid;
char *comma;
-
+
dbus_error_init (&error);
session_addr_no_guid = strdup (getenv ("DBUS_SESSION_BUS_ADDRESS"));
comma = strchr (session_addr_no_guid, ',');
- if (comma == NULL)
- die ("Couldn't find GUID in session bus address");
+
+#ifdef DBUS_WIN
+ _dbus_assert (comma == NULL);
+#else
+ _dbus_assert (comma != NULL);
*comma = '\0';
-
+#endif
+
connection = dbus_connection_open (session_addr_no_guid, &error);
free (session_addr_no_guid);
if (connection == NULL)