mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-08 20:38:11 +02:00
[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.
This commit is contained in:
parent
d9aa8907f3
commit
648745cddb
1 changed files with 7 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue