diff options
author | Ray Strode <rstrode@redhat.com> | 2022-11-28 19:17:33 -0500 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2022-11-28 19:19:13 -0500 |
commit | 8cb20287b02716c2348b8d57812657001a7801e1 (patch) | |
tree | 4c795ce6b58ec1f049bcd40e9fe316d774ed8b4f /src/libply-splash-core | |
parent | ca15d30c2ffbc778aa2bfa1e0a30dc2cae9c914e (diff) |
device-manager: Ensure local_console_terminal isn't NULL
We thought we could get away with a NULL local_console_terminal
when the terminal isn't a VT, but it turns out we need it for
various reasons anyway.
This commit just makes sure we keep it in place.
Diffstat (limited to 'src/libply-splash-core')
-rw-r--r-- | src/libply-splash-core/ply-device-manager.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c index 04a17e8e..3e02326a 100644 --- a/src/libply-splash-core/ply-device-manager.c +++ b/src/libply-splash-core/ply-device-manager.c @@ -430,7 +430,9 @@ create_devices_for_udev_device (ply_device_manager_t *manager, if (renderer_type != PLY_RENDERER_TYPE_NONE) { ply_terminal_t *terminal = NULL; - if (!manager->local_console_managed) { + if (!manager->local_console_managed && + manager->local_console_terminal != NULL && + ply_terminal_is_vt (manager->local_console_terminal)) { terminal = manager->local_console_terminal; } @@ -859,7 +861,6 @@ ply_device_manager_new (const char *default_tty, ply_device_manager_flags_t flags) { ply_device_manager_t *manager; - ply_terminal_t *terminal; manager = calloc (1, sizeof(ply_device_manager_t)); manager->loop = NULL; @@ -868,17 +869,10 @@ ply_device_manager_new (const char *default_tty, parse_vconsole_conf (manager); - terminal = ply_terminal_new (default_tty, manager->keymap); - - if (!ply_terminal_is_vt (terminal)) { - ply_terminal_free (terminal); - terminal = NULL; - } - manager->terminals = ply_hashtable_new (ply_hashtable_string_hash, ply_hashtable_string_compare); manager->renderers = ply_hashtable_new (ply_hashtable_string_hash, ply_hashtable_string_compare); + manager->local_console_terminal = ply_terminal_new (default_tty, manager->keymap); manager->input_devices = ply_hashtable_new (ply_hashtable_string_hash, ply_hashtable_string_compare); - manager->local_console_terminal = terminal; manager->keyboards = ply_list_new (); manager->text_displays = ply_list_new (); manager->pixel_displays = ply_list_new (); |