mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-28 06:35:34 +07:00
logind: more robust handling of VT-less systems
Restore the check that was removed in commit 74afee9c
. Its removal
caused a regression on some s390x systems where for whatever reason the
device node /dev/tty0 exists and makes the preceding access() check
pass.
This commit is contained in:
parent
98709151f3
commit
cdc564d27f
@ -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);
|
m->console_active_fd = open("/sys/class/tty/tty0/active", O_RDONLY|O_NOCTTY|O_CLOEXEC);
|
||||||
if (m->console_active_fd < 0) {
|
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");
|
log_error("Failed to open /sys/class/tty/tty0/active: %m");
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user