Blame SOURCES/0003-startx-Make-startx-auto-display-select-work-with-per.patch

4b5022
From 72939fed64b00be4a74dd0e1bf0b418e00ac4c57 Mon Sep 17 00:00:00 2001
4b5022
From: Hans de Goede <hdegoede@redhat.com>
4b5022
Date: Fri, 20 Mar 2015 14:30:08 +0100
4b5022
Subject: [PATCH xinit 3/3] startx: Make startx auto display select work with
4b5022
 per user /tmp dirs
4b5022
4b5022
If a separate /tmp per user is used the existing auto display select code
4b5022
does not work, add an extra check for the unix socket for the display number
4b5022
existing in /proc/net/unix (linux only).
4b5022
4b5022
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
4b5022
---
4b5022
 startx.cpp | 6 +++++-
4b5022
 1 file changed, 5 insertions(+), 1 deletion(-)
4b5022
4b5022
diff --git a/startx.cpp b/startx.cpp
4b5022
index fe49996..3b0dd86 100644
4b5022
--- a/startx.cpp
4b5022
+++ b/startx.cpp
4b5022
@@ -120,7 +120,11 @@ enable_xauth=1
4b5022
 XCOMM Automatically determine an unused $DISPLAY
4b5022
 d=0
4b5022
 while true ; do
4b5022
-    [ -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ] || break
4b5022
+    [ -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ] ||
4b5022
+#ifdef __linux__
4b5022
+        grep -q "/tmp/.X11-unix/X$d" "/proc/net/unix" ||
4b5022
+#endif
4b5022
+        break
4b5022
     d=$(($d + 1))
4b5022
 done
4b5022
 defaultdisplay=":$d"
4b5022
-- 
4b5022
2.3.3
4b5022