summaryrefslogtreecommitdiff
path: root/tools/dbus-launch.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-02-25 12:49:54 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-05-25 17:38:44 +0100
commitcea055514a9dfc74e7f0515cf4a256da10a891bc (patch)
tree7eebfffd15b9a50bb940df402aeef5fc982a85b5 /tools/dbus-launch.c
parent2bfac1b73d7aa1524452a16ff85a025c61883f8a (diff)
downloaddbus-cea055514a9dfc74e7f0515cf4a256da10a891bc.tar.gz
Check for X even if X11 autolaunching is disabled
DBUS_ENABLE_X11_AUTOLAUNCH obviously requires DBUS_BUILD_X11. However, the converse is not true. If DBUS_BUILD_X11 is defined, dbus-launch will be able to connect to the X server to determine when the session ends; most distributors will want this, but it can be disabled with the standard Autoconf option --without-x. If DBUS_ENABLE_X11_AUTOLAUNCH is *also* defined, dbus-launch and libdbus will be willing to perform autolaunch. Again, most distributors will want this, but it can be disabled with --disable-x11-autolaunch. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19997 Reviewed-by: Colin Walters <walters@verbum.org>
Diffstat (limited to 'tools/dbus-launch.c')
-rw-r--r--tools/dbus-launch.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/dbus-launch.c b/tools/dbus-launch.c
index af935386..bbaac2c3 100644
--- a/tools/dbus-launch.c
+++ b/tools/dbus-launch.c
@@ -917,7 +917,11 @@ main (int argc, char **argv)
fprintf (stderr, "Autolaunch requested, but X11 support not compiled in.\n"
"Cannot continue.\n");
exit (1);
-#else
+#else /* DBUS_BUILD_X11 */
+#ifndef DBUS_ENABLE_X11_AUTOLAUNCH
+ fprintf (stderr, "X11 autolaunch support disabled at compile time.\n");
+ exit (1);
+#else /* DBUS_ENABLE_X11_AUTOLAUNCH */
char *address;
pid_t pid;
long wid;
@@ -954,11 +958,12 @@ main (int argc, char **argv)
bourne_shell_syntax, binary_syntax, argc, argv, remaining_args);
exit (0);
}
+#endif /* DBUS_ENABLE_X11_AUTOLAUNCH */
}
- else if (read_machine_uuid_if_needed())
+ else if (read_machine_uuid_if_needed())
{
x11_init();
-#endif
+#endif /* DBUS_BUILD_X11 */
}
@@ -1177,7 +1182,7 @@ main (int argc, char **argv)
close (bus_pid_to_launcher_pipe[READ_END]);
-#ifdef DBUS_BUILD_X11
+#ifdef DBUS_ENABLE_X11_AUTOLAUNCH
if (xdisplay != NULL)
{
verbose("Saving x11 address\n");