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

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