[systemd-devel] [PATCH 07/10] logind: fix seat_can_tty() to check for VTs

David Herrmann dh.herrmann at gmail.com
Sun Aug 25 05:46:12 PDT 2013


A seat provides text-logins if it has VTs. This is always limited to seat0
so the seat_is_seat0() check is correct. However, if VTs are disabled, no
seat provides text-logins so we also need to check for the console-fd.

This was previously:
  return seat_is_vtconsole();
It looked right, but was functionally equivalent to seat_is_seat0(). The
rename of this helper made it more obvious that it is missing the VT test.
---
 src/login/logind-seat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
index 88fd724..4c2c424 100644
--- a/src/login/logind-seat.c
+++ b/src/login/logind-seat.c
@@ -450,7 +450,7 @@ bool seat_can_multi_session(Seat *s) {
 bool seat_can_tty(Seat *s) {
         assert(s);
 
-        return seat_is_seat0(s);
+        return seat_is_seat0(s) && s->manager->console_active_fd >= 0;
 }
 
 bool seat_has_master_device(Seat *s) {
-- 
1.8.3.4



More information about the systemd-devel mailing list