summaryrefslogtreecommitdiff
path: root/src/libply-splash-core/ply-terminal.c
diff options
context:
space:
mode:
authornerdopolis <bluescreen_avenger@verizon.net>2023-12-07 16:36:12 -0500
committernerdopolis <bluescreen_avenger@verizon.net>2023-12-08 22:55:52 -0500
commit6f2c70c9e10d60e5d73991388da014a30376c876 (patch)
treedd6f9c1037e5666af3d87562e3b8b4ffb9b7237f /src/libply-splash-core/ply-terminal.c
parent6b79792829b2713bf4fab588622f102590736764 (diff)
ply-utils: Introduce ply_change_to_vt_with_fd () and ply_change_to_vt ()
Diffstat (limited to 'src/libply-splash-core/ply-terminal.c')
-rw-r--r--src/libply-splash-core/ply-terminal.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/libply-splash-core/ply-terminal.c b/src/libply-splash-core/ply-terminal.c
index 51280bc0..2638b2df 100644
--- a/src/libply-splash-core/ply-terminal.c
+++ b/src/libply-splash-core/ply-terminal.c
@@ -913,16 +913,6 @@ ply_terminal_get_vt_number (ply_terminal_t *terminal)
}
static bool
-set_active_vt (ply_terminal_t *terminal,
- int vt_number)
-{
- if (ioctl (terminal->fd, VT_ACTIVATE, vt_number) < 0)
- return false;
-
- return true;
-}
-
-static bool
wait_for_vt_to_become_active (ply_terminal_t *terminal,
int vt_number)
{
@@ -953,7 +943,7 @@ ply_terminal_activate_vt (ply_terminal_t *terminal)
if (terminal->is_active)
return true;
- if (!set_active_vt (terminal, terminal->vt_number)) {
+ if (!ply_change_to_vt_with_fd (terminal->vt_number, terminal->fd)) {
ply_trace ("unable to set active vt to %d: %m",
terminal->vt_number);
return false;
@@ -994,7 +984,7 @@ ply_terminal_deactivate_vt (ply_terminal_t *terminal)
if (ply_terminal_is_active (terminal)) {
ply_trace ("Attempting to set active vt back to %d from %d",
terminal->initial_vt_number, old_vt_number);
- if (!set_active_vt (terminal, terminal->initial_vt_number)) {
+ if (!ply_change_to_vt_with_fd (terminal->initial_vt_number, terminal->fd)) {
ply_trace ("Couldn't move console to initial vt: %m");
return false;
}