From 5c06c1337adf69d8a7368d3cdcb82242ee895b2a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 8 May 2013 15:26:14 +0100 Subject: [PATCH] Fix compiler warnings when X11 autolaunch and launchd are both disabled From the department of "if it isn't tested, it doesn't work". I tried compiling dbus without an assortment of optional features: in_builddir ~/build/dbus/legacy ${MR_REPO}/configure \ --enable-developer --enable-maintainer-mode --enable-tests \ dbus_cv_sync_sub_and_fetch=no \ --disable-selinux \ --disable-inotify \ --disable-dnotify \ --disable-epoll \ --disable-kqueue \ --disable-launchd \ --disable-systemd \ --disable-libaudit \ --without-valgrind \ --disable-x11-autolaunch \ && ... and it resulted in -Wunused warnings. The tests also fail with dbus_cv_sync_sub_and_fetch=no, but that's a separate issue. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64362 Signed-off-by: Simon McVittie --- dbus/dbus-sysdeps-unix.c | 2 ++ tools/dbus-launch.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 34dfbe7..d3dd600 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -3220,6 +3220,7 @@ _dbus_get_tmpdir(void) return tmpdir; } +#if defined(DBUS_ENABLE_X11_AUTOLAUNCH) || defined(DBUS_ENABLE_LAUNCHD) /** * Execute a subprocess, returning up to 1024 bytes of output * into @p result. @@ -3421,6 +3422,7 @@ _read_subprocess_line_argv (const char *progpath, return retval; } +#endif /** * Returns the address of a new session bus. diff --git a/tools/dbus-launch.c b/tools/dbus-launch.c index 2a9dabf..b2ffe41 100644 --- a/tools/dbus-launch.c +++ b/tools/dbus-launch.c @@ -1162,7 +1162,6 @@ main (int argc, char **argv) char *end; long wid = 0; long val; - int ret2; verbose ("=== Parent dbus-launch continues\n"); @@ -1236,6 +1235,8 @@ main (int argc, char **argv) #ifdef DBUS_ENABLE_X11_AUTOLAUNCH if (xdisplay != NULL) { + int ret2; + verbose("Saving x11 address\n"); ret2 = x11_save_address (bus_address, bus_pid, &wid); /* Only get an existing dbus session when autolaunching */ -- 1.7.10.4