From 54e78e9e26d267915517f4e49e9868b3b3009c42 Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 26 Oct 2018 18:46:57 +0200 Subject: xwayland: don't fail if XDG_RUNTIME_DIR is not set We don't require it, Xwayland doesn't require it, and all X11 apps I tried don't need it. --- xwayland/xwayland.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'xwayland/xwayland.c') diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c index fe09ea5e..d92d58fb 100644 --- a/xwayland/xwayland.c +++ b/xwayland/xwayland.c @@ -105,17 +105,15 @@ static void exec_xwayland(struct wlr_xwayland *wlr_xwayland) { const char *xdg_runtime = getenv("XDG_RUNTIME_DIR"); const char *path_var = getenv("PATH"); - if (!xdg_runtime) { - wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is not set"); - _exit(EXIT_FAILURE); - } - - if (clearenv()) { + if (clearenv() != 0) { wlr_log_errno(WLR_ERROR, "clearenv failed"); _exit(EXIT_FAILURE); } - setenv("XDG_RUNTIME_DIR", xdg_runtime, true); + if (xdg_runtime != NULL) { + setenv("XDG_RUNTIME_DIR", xdg_runtime, true); + } setenv("PATH", path_var, true); + char wayland_socket_str[16]; snprintf(wayland_socket_str, sizeof(wayland_socket_str), "%d", wlr_xwayland->wl_fd[1]); setenv("WAYLAND_SOCKET", wayland_socket_str, true); -- cgit v1.2.3