diff options
Diffstat (limited to 'src/vt.c')
-rw-r--r-- | src/vt.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 |