summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--src/vt.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index dbc0c9d0..e67c0aee 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,9 @@ Overview of changes in lightdm 1.1.2
* Add regression tests for getting the user language and layout
* Stop accidentally distributing libsystem
* Fix introspection bindings not containing any methods
+ * lightdm-set-defaults can now set the autologin user
+ * Wait for the VT to become active when switching to avoid a suspected
+ race condition somewhere between LightDM, X, ConsoleKit and the kernel.
Overview of changes in lightdm 1.1.1
diff --git a/src/vt.c b/src/vt.c
index 62839d9d..a0fe2091 100644
--- a/src/vt.c
+++ b/src/vt.c
@@ -80,8 +80,16 @@ vt_set_active (gint number)
if (console_fd >= 0)
{
int n = number;
+
if (ioctl (console_fd, VT_ACTIVATE, n) < 0)
g_warning ("Error using VT_ACTIVATE %d on /dev/console: %s", n, strerror (errno));
+
+ /* Wait for the VT to become active to avoid a suspected
+ * race condition somewhere between LightDM, X, ConsoleKit and the kernel.
+ * See https://bugs.launchpad.net/bugs/851612 */
+ if (ioctl (console_fd, VT_WAITACTIVE) < 0)
+ g_warning ("Error using VT_WAITACTIVE %d on /dev/console: %s", n, strerror (errno));
+
close (console_fd);
}
#endif