chiark / gitweb /
logind: fix seat_can_tty() to check for VTs
authorDavid Herrmann <dh.herrmann@gmail.com>
Tue, 17 Sep 2013 15:40:00 +0000 (17:40 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 17 Sep 2013 18:48:23 +0000 (13:48 -0500)
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

index 9b6ceb31af09a76bc7976de0b129d16cf14dc34b..c5350fbf53366c2bd988212a2b2ab5ec68f0f387 100644 (file)
@@ -445,7 +445,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) {