-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(x11/weston): hardcoded paths (#18855)
- Loading branch information
1 parent
37cd4ca
commit 85ef203
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- a/xwayland/launcher.c | ||
+++ b/xwayland/launcher.c | ||
@@ -78,9 +78,9 @@ | ||
{ | ||
char path[256]; | ||
|
||
- snprintf(path, sizeof path, "/tmp/.X%d-lock", wxs->display); | ||
+ snprintf(path, sizeof path, "@TERMUX_PREFIX@/tmp/.X%d-lock", wxs->display); | ||
unlink(path); | ||
- snprintf(path, sizeof path, "/tmp/.X11-unix/X%d", wxs->display); | ||
+ snprintf(path, sizeof path, "@TERMUX_PREFIX@/tmp/.X11-unix/X%d", wxs->display); | ||
unlink(path); | ||
if (wxs->client) { | ||
wl_client_destroy(wxs->client); | ||
@@ -111,7 +111,7 @@ | ||
|
||
addr.sun_family = AF_LOCAL; | ||
name_size = snprintf(addr.sun_path, sizeof addr.sun_path, | ||
- "%c/tmp/.X11-unix/X%d", 0, display); | ||
+ "%c@TERMUX_PREFIX@/tmp/.X11-unix/X%d", 0, display); | ||
size = offsetof(struct sockaddr_un, sun_path) + name_size; | ||
if (bind(fd, (struct sockaddr *) &addr, size) < 0) { | ||
weston_log("failed to bind to @%s: %s\n", addr.sun_path + 1, | ||
@@ -141,7 +141,7 @@ | ||
|
||
addr.sun_family = AF_LOCAL; | ||
name_size = snprintf(addr.sun_path, sizeof addr.sun_path, | ||
- "/tmp/.X11-unix/X%d", display) + 1; | ||
+ "@TERMUX_PREFIX@/tmp/.X11-unix/X%d", display) + 1; | ||
size = offsetof(struct sockaddr_un, sun_path) + name_size; | ||
unlink(addr.sun_path); | ||
if (bind(fd, (struct sockaddr *) &addr, size) < 0) { | ||
@@ -169,7 +169,7 @@ | ||
int fd, size; | ||
pid_t other; | ||
|
||
- snprintf(lockfile, lsize, "/tmp/.X%d-lock", display); | ||
+ snprintf(lockfile, lsize, "@TERMUX_PREFIX@/tmp/.X%d-lock", display); | ||
fd = open(lockfile, O_WRONLY | O_CLOEXEC | O_CREAT | O_EXCL, 0444); | ||
if (fd < 0 && errno == EEXIST) { | ||
fd = open(lockfile, O_CLOEXEC | O_RDONLY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters