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

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