X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogind-seat.c;h=1bc0570517bdcb8f33b11aa4f5e09a9b33e675ec;hb=193197e85ccc5622abd9653dcd939712334d3ea3;hp=ed67bc9eea8d4fc89a354e97d02cd67e941c6545;hpb=30ed21ceb133173c849151c9fd6848bb34bb29bf;p=elogind.git diff --git a/src/logind-seat.c b/src/logind-seat.c index ed67bc9ee..1bc057051 100644 --- a/src/logind-seat.c +++ b/src/logind-seat.c @@ -117,27 +117,20 @@ int seat_save(Seat *s) { if (s->sessions) { Session *i; - fputs("OTHER=", f); + fputs("SESSIONS=", f); LIST_FOREACH(sessions_by_seat, i, s->sessions) { - if (i == s->active) - continue; - fprintf(f, "%s%c", i->id, i->sessions_by_seat_next ? ' ' : '\n'); } - fputs("OTHER_UIDS=", f); - LIST_FOREACH(sessions_by_seat, i, s->sessions) { - if (i == s->active) - continue; - + fputs("UIDS=", f); + LIST_FOREACH(sessions_by_seat, i, s->sessions) fprintf(f, "%lu%c", (unsigned long) i->user->uid, i->sessions_by_seat_next ? ' ' : '\n'); - } } fflush(f); @@ -253,11 +246,15 @@ int seat_set_active(Seat *s, Session *session) { seat_save(s); - if (session) + if (session) { session_save(session); + user_save(session->user); + } - if (old_active) + if (old_active) { session_save(old_active); + user_save(old_active->user); + } return 0; } @@ -340,11 +337,11 @@ int seat_start(Seat *s) { /* Read current VT */ seat_read_active_vt(s); + s->started = true; + /* Save seat data */ seat_save(s); - s->started = true; - seat_send_signal(s, true); return 0; @@ -452,6 +449,9 @@ int seat_get_idle_hint(Seat *s, dual_timestamp *t) { int seat_check_gc(Seat *s) { assert(s); + if (!s->started) + return 0; + if (seat_is_vtconsole(s)) return 1;