X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flogin%2Flogind-seat.c;h=c73860478d1619dd71bdfd897fd0d9880ffa2a0a;hp=eac5a5f26b144de064d61ea0ea0a9183a52c248f;hb=ec202eae8e84a4c99f054f771cb832046cb8769f;hpb=92bd5ff3a062c3f9475b9d9d39b9335bfeb7705e diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c index eac5a5f26..c73860478 100644 --- a/src/login/logind-seat.c +++ b/src/login/logind-seat.c @@ -51,7 +51,7 @@ Seat *seat_new(Manager *m, const char *id) { return NULL; } - s->id = path_get_file_name(s->state_file); + s->id = basename(s->state_file); s->manager = m; if (hashmap_put(m->seats, s->id, s) < 0) { @@ -408,6 +408,9 @@ int seat_attach_session(Seat *s, Session *session) { assert(session); assert(!session->seat); + if (!seat_has_vts(s) != !session->vtnr) + return -EINVAL; + session->seat = s; LIST_PREPEND(sessions_by_seat, s->sessions, session);