chiark / gitweb /
getty-generator: fix handling systems without a console
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sun, 2 Dec 2012 17:06:35 +0000 (18:06 +0100)
committerKay Sievers <kay@vrfy.org>
Sun, 2 Dec 2012 17:18:27 +0000 (18:18 +0100)
If the system does not have any active console, we should not try to
create an empty symlink. Instead, create no symlink at all.

Otherwise, on systems with CONFIG_VT=n and no serial console, we will
create a symlink with an empty template parameter.

src/getty-generator/getty-generator.c

index 1cef6aeae999851db56328badeae72fd00dc5a26..cb38f21052e6e3ec476a4a5423e963d6b8a3c67d 100644 (file)
@@ -131,7 +131,7 @@ int main(int argc, char *argv[]) {
 
                 /* Automatically add in a serial getty on the kernel
                  * console */
-                if (tty_is_vc(tty))
+                if (isempty(tty) || tty_is_vc(tty))
                         free(active);
                 else {
                         int k;