Blame SOURCES/0002-startx-Fix-startx-picking-an-already-used-display-nu.patch

4b5022
From 848dc9b7f3a95f14efd4ea34188cba51965c9f53 Mon Sep 17 00:00:00 2001
4b5022
From: Hans de Goede <hdegoede@redhat.com>
4b5022
Date: Fri, 20 Mar 2015 14:25:44 +0100
4b5022
Subject: [PATCH xinit 2/3] startx: Fix startx picking an already used display
4b5022
 number when -nolock is used
4b5022
4b5022
Currently startx relies on /tmp/.X?-lock being present for automatically
4b5022
picking a free display number. This does not work if -nolock is used when
4b5022
starting the server, or if the server is started with -displayfd as -displayfd
4b5022
implies -nolock.
4b5022
4b5022
This is becoming a problem now that -displayfd is getting used by
4b5022
display-managers (e.g. gdm), this fixes this by also checking for
4b5022
/tmp/.X11-unix/X?
4b5022
4b5022
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
4b5022
---
4b5022
 startx.cpp | 2 +-
4b5022
 1 file changed, 1 insertion(+), 1 deletion(-)
4b5022
4b5022
diff --git a/startx.cpp b/startx.cpp
4b5022
index 8520399..fe49996 100644
4b5022
--- a/startx.cpp
4b5022
+++ b/startx.cpp
4b5022
@@ -120,7 +120,7 @@ enable_xauth=1
4b5022
 XCOMM Automatically determine an unused $DISPLAY
4b5022
 d=0
4b5022
 while true ; do
4b5022
-    [ -e /tmp/.X$d-lock ] || break
4b5022
+    [ -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ] || break
4b5022
     d=$(($d + 1))
4b5022
 done
4b5022
 defaultdisplay=":$d"
4b5022
-- 
4b5022
2.3.3
4b5022