From 9b7cd30adfc29dfb3e50f8dd1ff857ad1d4b4f3d Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 25 Jun 2012 20:59:18 +0100 Subject: [PATCH] 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 dbus-1.6 let's just provide the prerequisite. 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 dcce646..03e25fb 100644 --- a/tools/dbus-launch.c +++ b/tools/dbus-launch.c @@ -1023,6 +1023,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