summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Terry <michael.terry@canonical.com>2016-10-20 10:53:37 +0200
committerMichael Terry <michael.terry@canonical.com>2016-10-20 10:53:37 +0200
commitfc5ef948b154bbaf091a8c40fba0b7bc5a5f9bf1 (patch)
tree25cc1f706dbba4f7557f708463e968402ca824b9 /src
parent54c11400ce3da1cf950543ca9a9b41cb83e626d7 (diff)
downloadlightdm-git-fc5ef948b154bbaf091a8c40fba0b7bc5a5f9bf1.tar.gz
Update vt ioctl usage
Diffstat (limited to 'src')
-rw-r--r--src/vt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vt.c b/src/vt.c
index 8d31f78b..d784a8c8 100644
--- a/src/vt.c
+++ b/src/vt.c
@@ -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);