diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-10-28 23:05:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-28 23:05:21 +0100 |
commit | 659d39baaaa51e27c3e078390e3f1b588f390aa3 (patch) | |
tree | ffd5bc8bef3055653400f48837b2017bbaecb762 /xwayland | |
parent | f668e49faeeb06bf71e8b0d21f745e0f68aab4ba (diff) | |
parent | 54e78e9e26d267915517f4e49e9868b3b3009c42 (diff) | |
download | wlroots-659d39baaaa51e27c3e078390e3f1b588f390aa3.tar.xz |
Merge pull request #1332 from emersion/shm-open
util: use shm_open for in-memory files
Diffstat (limited to 'xwayland')
-rw-r--r-- | xwayland/xwayland.c | 12 |
1 files changed, 5 insertions, 7 deletions
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); |