chiark / gitweb /
logind: more robust handling of VT-less systems
[elogind.git] / src / login / logind.c
index 62f7914fec41d753633d9517a49dac3de4284357..1eb745adcecfafb9166ca506bb75da5a26cc6a52 100644 (file)
@@ -1244,6 +1244,12 @@ static int manager_connect_console(Manager *m) {
 
         m->console_active_fd = open("/sys/class/tty/tty0/active", O_RDONLY|O_NOCTTY|O_CLOEXEC);
         if (m->console_active_fd < 0) {
+
+                /* On some systems the device node /dev/tty0 may exist
+                 * even though /sys/class/tty/tty0 does not. */
+                if (errno == ENOENT)
+                        return 0;
+
                 log_error("Failed to open /sys/class/tty/tty0/active: %m");
                 return -errno;
         }