X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind-session.c;h=ff0a7a4f2e2253094317f1e2cba5a3d3b3636aac;hb=49e6fdbf14b35d8840c3b263fd15259624b07818;hp=4476f5820a4bee122ae7d4f6d4321ff77d311945;hpb=7f112f50fea585411ea2d493b3582bea77eb4d6e;p=elogind.git diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 4476f5820..ff0a7a4f2 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -125,6 +125,7 @@ void session_free(Session *s) { if (s->seat->pending_switch == s) s->seat->pending_switch = NULL; + seat_evict_position(s->seat, s); LIST_REMOVE(sessions_by_seat, s->seat->sessions, s); } @@ -231,6 +232,9 @@ int session_save(Session *s) { if (s->seat && seat_has_vts(s->seat)) fprintf(f, "VTNR=%u\n", s->vtnr); + if (!s->vtnr) + fprintf(f, "POS=%u\n", s->pos); + if (s->leader > 0) fprintf(f, "LEADER=%lu\n", (unsigned long) s->leader); @@ -266,6 +270,7 @@ int session_load(Session *s) { _cleanup_free_ char *remote = NULL, *seat = NULL, *vtnr = NULL, + *pos = NULL, *leader = NULL, *type = NULL, *class = NULL, @@ -290,6 +295,7 @@ int session_load(Session *s) { "REMOTE_USER", &s->remote_user, "SERVICE", &s->service, "VTNR", &vtnr, + "POS", &pos, "LEADER", &leader, "TYPE", &type, "CLASS", &class, @@ -350,6 +356,13 @@ int session_load(Session *s) { if (!s->seat || !seat_has_vts(s->seat)) s->vtnr = 0; + if (pos && s->seat) { + unsigned int npos; + + safe_atou(pos, &npos); + seat_claim_position(s->seat, s, npos); + } + if (leader) { k = parse_pid(leader, &s->leader); if (k >= 0)