]> err.no Git - systemd/commitdiff
logind: don't spawn autovt getty on more VTs than configured
authorLennart Poettering <lennart@poettering.net>
Tue, 28 Jun 2011 01:05:33 +0000 (03:05 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 28 Jun 2011 01:05:33 +0000 (03:05 +0200)
src/logind.c

index 8507c2e152a50f05b64b6f395fd2fd26764e3374..bb64ab2859ac099ad1a8dccfa2ad713977bb1011 100644 (file)
@@ -683,9 +683,14 @@ int manager_spawn_autovt(Manager *m, int vtnr) {
 
         dbus_error_init(&error);
 
+        if (vtnr > m->n_autovts)
+                return 0;
+
         r = vt_is_busy(vtnr);
-        if (r != 0)
+        if (r < 0)
                 return r;
+        else if (r > 0)
+                return -EBUSY;
 
         message = dbus_message_new_method_call("org.freedesktop.systemd1", "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "StartUnit");
         if (!message) {