From a5d1f67c34511cb89241d807df51db66557cb0ef Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 20 Mar 2015 15:09:13 -0400 Subject: [PATCH] wayland: try 50 times to create lock file again for login screen since commit 8c16ac47c1b88fc48ad8ea621a75a86e028a2764, we started creating the login screen on display 1024 instead of display 0. This defeats this logic in try_display: display++; /* If display is above 50, then something's wrong. Just * abort in this case. */ if (display > 50) In practice it doesn't matter much since we only have one login screen in most setups, but we should still fix the bug. This commit introduces a separate counter to keep try of 50 tries, rather than assuming "display number == number of tries". https://bugzilla.gnome.org/show_bug.cgi?id=746545 --- src/wayland/meta-xwayland.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index 806614bc6..8d563de79 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -228,14 +228,16 @@ create_lockfile (int display, int *display_out) char pid[11]; int size; + int number_of_tries = 0; while (!try_display (display, &filename, &fd)) { display++; + number_of_tries++; - /* If display is above 50, then something's wrong. Just + /* If we can't get a display after 50 times, then something's wrong. Just * abort in this case. */ - if (display > 50) + if (number_of_tries >= 50) return NULL; }