From: Ray Strode Date: Wed, 2 Jun 2010 22:28:02 +0000 (-0400) Subject: [keyboard] Don't blow an assertion if terminal is unavailable X-Git-Tag: 0.8.4~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=648745cddb47f0d3977f373e34ec285c9dc53e4f;p=thirdparty%2Fplymouth.git [keyboard] Don't blow an assertion if terminal is unavailable Right now, we always assume the tty can be reopened when it gets disconnected. This isn't always true. While plymouth clearly won't function 100% properly without a tty, we shouldn't blow an assertion. --- diff --git a/src/libply-splash-core/ply-keyboard.c b/src/libply-splash-core/ply-keyboard.c index 0df3ab48..0f26bb42 100644 --- a/src/libply-splash-core/ply-keyboard.c +++ b/src/libply-splash-core/ply-keyboard.c @@ -359,6 +359,13 @@ ply_keyboard_watch_for_terminal_input (ply_keyboard_t *keyboard) assert (keyboard != NULL); terminal_fd = ply_terminal_get_fd (keyboard->provider.if_terminal->terminal); + + if (terminal_fd < 0 || !ply_terminal_is_open (keyboard->provider.if_terminal->terminal)) + { + ply_trace ("terminal associated with keyboard isn't open"); + return false; + } + keyboard->provider.if_terminal->input_watch = ply_event_loop_watch_fd (keyboard->loop, terminal_fd, PLY_EVENT_LOOP_FD_STATUS_HAS_DATA, (ply_event_handler_t) on_terminal_data, (ply_event_handler_t) on_terminal_disconnected,