]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[console] Function in degraded mode when closed
authorRay Strode <rstrode@redhat.com>
Thu, 29 Oct 2009 21:11:00 +0000 (17:11 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 29 Oct 2009 21:11:00 +0000 (17:11 -0400)
Not all machines will have /dev/tty0.  Those that
don't should still work.

src/libplybootsplash/ply-console.c
src/main.c

index fb5a86dbb64e57b483ffc6db7fc4f530c8e42373..10e8ce4ef7791de59f9cf43236ff9d5574103891 100644 (file)
@@ -190,10 +190,12 @@ static void
 ply_console_watch_for_vt_changes (ply_console_t *console)
 {
   assert (console != NULL);
-  assert (console->fd >= 0);
 
   struct vt_mode mode = { 0 };
 
+  if (console->fd < 0);
+    return;
+
   if (console->is_watching_for_vt_changes)
     return;
 
@@ -349,7 +351,9 @@ ply_console_set_active_vt (ply_console_t *console,
                            int            vt_number)
 {
   assert (console != NULL);
-  assert (vt_number > 0);
+
+  if (vt_number <= 0)
+    return false;
 
   if (vt_number == console->active_vt)
     return true;
index abfd430c91f8ea63ad749b19577e2172b3a71744..548e1f71a7faee59835b4bd9fe688381e7c94a66 100644 (file)
@@ -1293,9 +1293,6 @@ check_for_consoles (state_t    *state,
       !ply_console_open (state->console))
     {
       ply_trace ("could not open /dev/tty0");
-      ply_console_free (state->console);
-      state->console = NULL;
-      return;
     }
 
   remaining_command_line = state->kernel_command_line;