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

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