diff options
author | Michael Terry <michael.terry@canonical.com> | 2016-10-20 10:53:37 +0200 |
---|---|---|
committer | Michael Terry <michael.terry@canonical.com> | 2016-10-20 10:53:37 +0200 |
commit | fc5ef948b154bbaf091a8c40fba0b7bc5a5f9bf1 (patch) | |
tree | 25cc1f706dbba4f7557f708463e968402ca824b9 /src | |
parent | 54c11400ce3da1cf950543ca9a9b41cb83e626d7 (diff) | |
download | lightdm-git-fc5ef948b154bbaf091a8c40fba0b7bc5a5f9bf1.tar.gz |
Update vt ioctl usage
Diffstat (limited to 'src')
-rw-r--r-- | src/vt.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -92,12 +92,16 @@ vt_set_active (gint number) int n = number; if (ioctl (tty_fd, VT_ACTIVATE, n) < 0) + { g_warning ("Error using VT_ACTIVATE %d on /dev/tty0: %s", n, strerror (errno)); + close (tty_fd); + return; + } /* 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 (tty_fd, VT_WAITACTIVE) < 0) + if (ioctl (tty_fd, VT_WAITACTIVE, n) < 0) g_warning ("Error using VT_WAITACTIVE %d on /dev/tty0: %s", n, strerror (errno)); close (tty_fd); |