[mutter] wayland: try 50 times to create lock file again for login screen



commit a5d1f67c34511cb89241d807df51db66557cb0ef
Author: Ray Strode <rstrode redhat com>
Date:   Fri Mar 20 15:09:13 2015 -0400

    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 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index 806614b..8d563de 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;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]