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.
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,