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

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