chiark / gitweb /
Get rid of our reimplementation of basename
[elogind.git] / src / login / logind-seat.c
index eac5a5f26b144de064d61ea0ea0a9183a52c248f..c73860478d1619dd71bdfd897fd0d9880ffa2a0a 100644 (file)
@@ -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);