]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
main: Always translate tty0 to tty1
authorRay Strode <rstrode@redhat.com>
Sat, 20 Nov 2010 00:33:34 +0000 (19:33 -0500)
committerRay Strode <rstrode@redhat.com>
Sat, 20 Nov 2010 00:33:34 +0000 (19:33 -0500)
Another bug in check_for_consoles...

We can't ever write to tty0 directly, because
it is redirected (just like /dev/console).  Previously
we would translate the call to tty1, but commit

c40fd792b6edf931a6bbe2ec23518b57483a4e2f

broke that.  This commit fixes it again.

src/main.c

index b6ee8780b727f60b047d6a254c19346c4c476d15..1f55ff9bea74cdfd42d555e606388619455acd4e 100644 (file)
@@ -1784,6 +1784,12 @@ check_for_consoles (state_t    *state,
       if (end != NULL)
         *end = '\0';
 
+      if (strcmp (console, "tty0") == 0 || strcmp (console, "/dev/tty0") == 0)
+        {
+          free (console);
+          console = strdup (default_tty);
+        }
+
       ply_trace ("serial console %s found!", console);
       ply_hashtable_insert (consoles, console, NULL);
 
@@ -1794,12 +1800,7 @@ check_for_consoles (state_t    *state,
   state->kernel_console_tty = NULL;
 
   if (console != NULL)
-    {
-      if (strcmp (console, "tty0") == 0 || strcmp (console, "/dev/tty0") == 0)
-          state->kernel_console_tty = strdup (default_tty);
-      else
-          state->kernel_console_tty = strdup (console);
-    }
+    state->kernel_console_tty = strdup (console);
 
   if (should_add_displays)
     {