]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
um: xterm: Add Wayland support
authorTiwei Bie <tiwei.btw@antgroup.com>
Wed, 26 Mar 2025 07:01:12 +0000 (15:01 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 5 May 2025 08:21:15 +0000 (10:21 +0200)
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>
arch/um/drivers/xterm.c

index e4316c7981e80229d5363c3aa29bac52c071db2c..f607af738eac93083e6873b2efd2a451dc4a4ad6 100644 (file)
@@ -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;
        }