X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind-seat.c;h=2c60b8ae510cc6a98d72bba020916cd98a8b7a14;hb=718d006a63f773c42106494e823250c48942cf08;hp=0ae0c520e6d564bfd5a993874d4419d1f98ba2cf;hpb=4a271908f1d46e0549a4d9bfc5d0e34266887695;p=elogind.git diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c index 0ae0c520e..2c60b8ae5 100644 --- a/src/login/logind-seat.c +++ b/src/login/logind-seat.c @@ -341,7 +341,7 @@ int seat_start(Seat *s) { return 0; log_struct(LOG_INFO, - "MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(SD_MESSAGE_SEAT_START), + MESSAGE_ID(SD_MESSAGE_SEAT_START), "SEAT_ID=%s", s->id, "MESSAGE=New seat %s.", s->id, NULL); @@ -369,7 +369,7 @@ int seat_stop(Seat *s) { if (s->started) log_struct(LOG_INFO, - "MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(SD_MESSAGE_SEAT_STOP), + MESSAGE_ID(SD_MESSAGE_SEAT_STOP), "SEAT_ID=%s", s->id, "MESSAGE=Removed seat %s.", s->id, NULL); @@ -448,10 +448,17 @@ bool seat_can_tty(Seat *s) { return seat_is_vtconsole(s); } +bool seat_has_master_device(Seat *s) { + assert(s); + + /* device list is ordered by "master" flag */ + return !!s->devices && s->devices->master; +} + bool seat_can_graphical(Seat *s) { assert(s); - return !!s->devices; + return seat_has_master_device(s); } int seat_get_idle_hint(Seat *s, dual_timestamp *t) { @@ -499,7 +506,7 @@ int seat_check_gc(Seat *s, bool drop_not_started) { if (seat_is_vtconsole(s)) return 1; - return !!s->devices; + return seat_has_master_device(s); } void seat_add_to_gc_queue(Seat *s) {