xwayland: Simplify HAVE_XWAYLAND_LISTENFD usage

We can use it just once to define a string instead of having preprocessor
conditionals sprinkled about the code.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
dev
Derek Foreman 3 years ago committed by Marius Vlad
parent edef874696
commit 869cab4938
  1. 21
      compositor/xwayland.c

@ -36,6 +36,12 @@
#include <libweston/xwayland-api.h>
#include "shared/helpers.h"
#ifdef HAVE_XWAYLAND_LISTENFD
# define LISTEN_STR "-listenfd"
#else
# define LISTEN_STR "-listen"
#endif
struct wet_xwayland {
struct weston_compositor *compositor;
const struct weston_xwayland_api *api;
@ -123,22 +129,13 @@ spawn_xserver(void *user_data, const char *display, int abstract_fd, int unix_fd
xserver,
display,
"-rootless",
#ifdef HAVE_XWAYLAND_LISTENFD
"-listenfd", abstract_fd_str,
"-listenfd", unix_fd_str,
#else
"-listen", abstract_fd_str,
"-listen", unix_fd_str,
#endif
LISTEN_STR, abstract_fd_str,
LISTEN_STR, unix_fd_str,
"-wm", wm_fd_str,
"-terminate",
NULL) < 0)
weston_log("exec of '%s %s -rootless "
#ifdef HAVE_XWAYLAND_LISTENFD
"-listenfd %s -listenfd %s "
#else
"-listen %s -listen %s "
#endif
LISTEN_STR " %s " LISTEN_STR " %s "
"-wm %s -terminate' failed: %s\n",
xserver, display,
abstract_fd_str, unix_fd_str, wm_fd_str,

Loading…
Cancel
Save