mirror of
https://github.com/brl/mutter.git
synced 2025-08-03 15:14:46 +00:00
wayland: try 50 times to create lock file again for login screen
since commit 8c16ac47c1
, 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
This commit is contained in:
@@ -228,14 +228,16 @@ create_lockfile (int display, int *display_out)
|
|||||||
|
|
||||||
char pid[11];
|
char pid[11];
|
||||||
int size;
|
int size;
|
||||||
|
int number_of_tries = 0;
|
||||||
|
|
||||||
while (!try_display (display, &filename, &fd))
|
while (!try_display (display, &filename, &fd))
|
||||||
{
|
{
|
||||||
display++;
|
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. */
|
* abort in this case. */
|
||||||
if (display > 50)
|
if (number_of_tries >= 50)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user