aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/um/drivers
diff options
context:
space:
mode:
authorTiwei Bie <tiwei.btw@antgroup.com>2025-03-26 15:01:12 +0800
committerJohannes Berg <johannes.berg@intel.com>2025-05-05 10:21:15 +0200
commit9456e2c60171ecffc0ea26347418e6bedb64ee78 (patch)
tree6c52759bbc10355278b3303ed66d3210a44237d0 /arch/um/drivers
parentLinux 6.15-rc5 (diff)
downloadwireguard-linux-9456e2c60171ecffc0ea26347418e6bedb64ee78.tar.xz
wireguard-linux-9456e2c60171ecffc0ea26347418e6bedb64ee78.zip
um: xterm: Add Wayland support
Under Wayland, we should check WAYLAND_DISPLAY instead. Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com> Link: https://patch.msgid.link/20250326070113.401857-2-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'arch/um/drivers')
-rw-r--r--arch/um/drivers/xterm.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c
index e4316c7981e8..f607af738eac 100644
--- a/arch/um/drivers/xterm.c
+++ b/arch/um/drivers/xterm.c
@@ -97,12 +97,9 @@ static int xterm_open(int input, int output, int primary, void *d,
if (access(argv[4], X_OK) < 0)
argv[4] = "port-helper";
- /*
- * Check that DISPLAY is set, this doesn't guarantee the xterm
- * will work but w/o it we can be pretty sure it won't.
- */
- if (getenv("DISPLAY") == NULL) {
- printk(UM_KERN_ERR "xterm_open: $DISPLAY not set.\n");
+ /* Ensure we are running on Xorg or Wayland. */
+ if (!getenv("DISPLAY") && !getenv("WAYLAND_DISPLAY")) {
+ printk(UM_KERN_ERR "xterm_open : neither $DISPLAY nor $WAYLAND_DISPLAY is set.\n");
return -ENODEV;
}