From 3ea1a41dbf8befb3f55da20c62b74d2e2d753f4a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 25 Jun 2012 20:59:18 +0100 Subject: [PATCH 2/2] dbus-launch: read machine UUID before x11_init if --exit-with-x11 is used The machine UUID is needed to set the X atoms. x11_init() assumes that the machine UUID (global variable) has been set, either via read_machine_uuid_if_needed() or save_machine_uuid(). This is pretty tangled, but to make The Right Thing happen automatically, we'd need to redo dbus-launch in terms of DBusError. For now let's just provide the prerequisite. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39197 Signed-off-by: Simon McVittie --- tools/dbus-launch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/dbus-launch.c b/tools/dbus-launch.c index b0d39bf..fc55f9b 100644 --- a/tools/dbus-launch.c +++ b/tools/dbus-launch.c @@ -1024,6 +1024,12 @@ main (int argc, char **argv) fprintf (stderr, "Session lifetime based on X11 requested, but X11 support not compiled in.\n"); exit (1); #else /* DBUS_BUILD_X11 */ + if (!read_machine_uuid_if_needed()) + { + fprintf (stderr, "Session lifetime based on X11 requested, but machine UUID unavailable.\n"); + exit (1); + } + if (!x11_init ()) { fprintf (stderr, "Session lifetime based on X11 requested, but X11 initialization failed.\n"); -- 1.7.10.4