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

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