diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2017-02-13 16:46:48 +1300 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2019-07-29 12:13:23 -0400 |
commit | e5e9b048f5336e76c31dbf1cd25298c0b292891a (patch) | |
tree | d4fcf439fda28bb19ad1d8924d86af05cceb7c4c | |
parent | 86999c6d923cd3f1c3f98a1c60e86f4b8a2dfc81 (diff) | |
download | lightdm-git-lightdm-1-18.tar.gz |
Retry VT_WAITACTIVE if we get EINTlightdm-1-18
-rw-r--r-- | src/vt.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -97,8 +97,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) < 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); } |