summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-03-20 14:25:44 +0100
committerHans de Goede <hdegoede@redhat.com>2015-03-25 09:33:26 +0100
commite07fa99039c0f63ed8f0b142e546ef102321fca0 (patch)
tree3bf6a4ee33040e86ef2bd2f08fc4946cc489cfa0
parenta3a34a393b9aeacc0b41dc9b4608ad2be25564cf (diff)
downloadxorg-app-xinit-e07fa99039c0f63ed8f0b142e546ef102321fca0.tar.gz
startx: Fix startx picking an already used display number when -nolock is used
Currently startx relies on /tmp/.X?-lock being present for automatically picking a free display number. This does not work if -nolock is used when starting the server, or if the server is started with -displayfd as -displayfd implies -nolock. This is becoming a problem now that -displayfd is getting used by display-managers (e.g. gdm), this fixes this by also checking for /tmp/.X11-unix/X? Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--startx.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/startx.cpp b/startx.cpp
index cc8be90..a9d477b 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -120,7 +120,7 @@ enable_xauth=1
XCOMM Automatically determine an unused $DISPLAY
d=0
while true ; do
- [ -e /tmp/.X$d-lock ] || break
+ [ -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ] || break
d=$(($d + 1))
done
defaultdisplay=":$d"