chiark / gitweb /
logind: properly preallocate configured auto VTs
[elogind.git] / src / logind-seat.c
index c232a87d5de8effd1b51b09971f569c5b4791f43..bc695fea837f7daddd9e9393443e952deaec548f 100644 (file)
@@ -86,6 +86,9 @@ int seat_save(Seat *s) {
 
         assert(s);
 
+        if (!s->started)
+                return 0;
+
         r = safe_mkdir("/run/systemd/seats", 0755, 0, 0);
         if (r < 0)
                 goto finish;
@@ -196,7 +199,7 @@ static int seat_preallocate_vts(Seat *s) {
         if (!seat_is_vtconsole(s))
                 return 0;
 
-        for (i = 1; i < s->manager->n_autovts; i++) {
+        for (i = 1; i <= s->manager->n_autovts; i++) {
                 int q;
 
                 q = vt_allocate(i);