From: Lennart Poettering Date: Tue, 28 Jun 2011 01:05:33 +0000 (+0200) Subject: logind: don't spawn autovt getty on more VTs than configured X-Git-Tag: v30~127 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=975fd86771220287cdc30824760ff147913a0bd6;p=systemd logind: don't spawn autovt getty on more VTs than configured --- diff --git a/src/logind.c b/src/logind.c index 8507c2e1..bb64ab28 100644 --- a/src/logind.c +++ b/src/logind.c @@ -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) {