X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind-seat.c;h=470d08bc05dbd13d68184f4178416cca72eb0b71;hb=90527fbb2c48ffda5c6d8f232f8993a90b2632a4;hp=045712192a35e0feecb9ff5044de1759aae2480a;hpb=f1a8e221ecacea23883df57951e291a910463948;p=elogind.git diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c index 045712192..470d08bc0 100644 --- a/src/login/logind-seat.c +++ b/src/login/logind-seat.c @@ -27,6 +27,8 @@ #include #include +#include "systemd/sd-id128.h" +#include "systemd/sd-messages.h" #include "logind-seat.h" #include "logind-acl.h" #include "util.h" @@ -261,7 +263,8 @@ int seat_set_active(Seat *s, Session *session) { if (old_active) { session_save(old_active); - user_save(old_active->user); + if (!session || session->user != old_active->user) + user_save(old_active->user); } return 0; @@ -337,7 +340,11 @@ int seat_start(Seat *s) { if (s->started) return 0; - log_info("New seat %s.", s->id); + log_struct(LOG_INFO, + MESSAGE_ID(SD_MESSAGE_SEAT_START), + "SEAT_ID=%s", s->id, + "MESSAGE=New seat %s.", s->id, + NULL); /* Initialize VT magic stuff */ seat_preallocate_vts(s); @@ -361,7 +368,11 @@ int seat_stop(Seat *s) { assert(s); if (s->started) - log_info("Removed seat %s.", s->id); + log_struct(LOG_INFO, + MESSAGE_ID(SD_MESSAGE_SEAT_STOP), + "SEAT_ID=%s", s->id, + "MESSAGE=Removed seat %s.", s->id, + NULL); seat_stop_sessions(s); @@ -460,7 +471,7 @@ int seat_get_idle_hint(Seat *s, dual_timestamp *t) { if (!ih) { if (!idle_hint) { - if (k.monotonic < ts.monotonic) + if (k.monotonic > ts.monotonic) ts = k; } else { idle_hint = false;