[1/2] support specifying custom directories for the client and server

Submitted by Imran Zaman on Oct. 15, 2014, 2:33 p.m.

Details

Message ID CAPfuZRhw62aaoOSocboeZoP-Q+p_CMa8DnB1G8iE25zUo1_2Ug@mail.gmail.com
State Superseded
Headers show

Not browsing as part of any series.

Commit Message

Imran Zaman Oct. 15, 2014, 2:33 p.m.
Hi

support specifying custom directories for the client and server
sockets through environment           variables.

This is in order to support nested compositor architectures where
system compositor using drm-backend is shared among multiple child
compositors using wayland-backend.
---

Patch hide | download patch | download mbox

diff --git a/src/wayland-client.c b/src/wayland-client.c
index 1229b5f..428af68 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -700,7 +700,9 @@  connect_to_socket(const char *name)
  const char *runtime_dir;
  int name_size, fd;

- runtime_dir = getenv("XDG_RUNTIME_DIR");
+ runtime_dir = getenv("WAYLAND_CLIENT_DIR");
+ if (runtime_dir == NULL)
+ runtime_dir = getenv("XDG_RUNTIME_DIR");
  if (!runtime_dir) {
  wl_log("error: XDG_RUNTIME_DIR not set in the environment.\n");
  /* to prevent programs reporting
diff --git a/src/wayland-server.c b/src/wayland-server.c
index e3b7d9f..ce1eca8 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -1080,7 +1080,9 @@  wl_socket_init_for_display_name(struct wl_socket
*s, const char *name)
  int name_size;
  const char *runtime_dir;

- runtime_dir = getenv("XDG_RUNTIME_DIR");
+ runtime_dir = getenv("WAYLAND_SERVER_DIR");
+ if (runtime_dir == NULL)
+ runtime_dir = getenv("XDG_RUNTIME_DIR");
  if (!runtime_dir) {
  wl_log("error: XDG_RUNTIME_DIR not set in the environment\n");