From 869cab49389cdef798ae286a310c62681b078973 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 23 Mar 2022 15:48:05 -0500 Subject: [PATCH] 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 --- compositor/xwayland.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/compositor/xwayland.c b/compositor/xwayland.c index 8cdf0555..06ca4919 100644 --- a/compositor/xwayland.c +++ b/compositor/xwayland.c @@ -36,6 +36,12 @@ #include #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,