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

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