diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2017-02-13 16:46:48 +1300 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2017-02-13 16:46:48 +1300 |
commit | 6b1811323b6dbe5ffb30122ea90ba3b5df9fa617 (patch) | |
tree | 26242f2dadf46bfc07de51c4e0fc3fa65176f3f9 /src | |
parent | bcf0124816857828e96b84dec0d003067ce4aecb (diff) | |
download | lightdm-git-6b1811323b6dbe5ffb30122ea90ba3b5df9fa617.tar.gz |
Retry VT_WAITACTIVE if we get EINT
Diffstat (limited to 'src')
-rw-r--r-- | src/vt.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -101,8 +101,17 @@ vt_set_active (gint number) /* 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, n) < 0) - g_warning ("Error using VT_WAITACTIVE %d on /dev/tty0: %s", n, strerror (errno)); + /* This call sometimes get interrupted (not sure what signal is causing it), so retry if that is the case */ + while (TRUE) + { + if (ioctl (tty_fd, VT_WAITACTIVE, n) < 0) + { + if (errno == EINTR) + continue; + g_warning ("Error using VT_WAITACTIVE %d on /dev/tty0: %s", n, strerror (errno)); + } + break; + } close (tty_fd); } |