From: Ray Strode Date: Thu, 29 Oct 2009 21:11:00 +0000 (-0400) Subject: [console] Function in degraded mode when closed X-Git-Tag: 0.8.0~152 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee7588b9d43c18330cd975914a3ec6b996058de5;p=thirdparty%2Fplymouth.git [console] Function in degraded mode when closed Not all machines will have /dev/tty0. Those that don't should still work. --- diff --git a/src/libplybootsplash/ply-console.c b/src/libplybootsplash/ply-console.c index fb5a86db..10e8ce4e 100644 --- a/src/libplybootsplash/ply-console.c +++ b/src/libplybootsplash/ply-console.c @@ -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; diff --git a/src/main.c b/src/main.c index abfd430c..548e1f71 100644 --- a/src/main.c +++ b/src/main.c @@ -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;