diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-06-28 03:05:33 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-06-28 03:05:33 +0200 |
commit | 975fd86771220287cdc30824760ff147913a0bd6 (patch) | |
tree | db8040b8183318b84908e872215cc0d948332c20 /src | |
parent | e7886786a6fec22fa770eb1554781d5f82c4b349 (diff) |
logind: don't spawn autovt getty on more VTs than configured
Diffstat (limited to 'src')
-rw-r--r-- | src/logind.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/logind.c b/src/logind.c index 8507c2e152..bb64ab2859 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) { |