drop take_console/give_console functions

We aren't really using them right now.
This commit is contained in:
Ray Strode 2008-10-01 14:54:27 -04:00
parent 88e1b4d417
commit dd710f097c
4 changed files with 1 additions and 73 deletions

View file

@ -836,56 +836,6 @@ ply_window_get_frame_buffer (ply_window_t *window)
return window->frame_buffer;
}
static bool
switch_to_vt (int tty_fd,
int vt_number)
{
if (ioctl (tty_fd, VT_ACTIVATE, vt_number) < 0)
return false;
ioctl (tty_fd, VT_WAITACTIVE, vt_number);
return get_active_vt () == vt_number;
}
bool
ply_window_take_console (ply_window_t *window)
{
assert (window != NULL);
return switch_to_vt (window->tty_fd, window->vt_number);
}
bool
ply_window_give_console (ply_window_t *window,
int vt_number)
{
char *tty_name;
int tty_fd;
bool vt_switched;
assert (window != NULL);
assert (vt_number > 0);
assert (vt_number != window->vt_number);
tty_name = NULL;
asprintf (&tty_name, "/dev/tty%d", vt_number);
tty_fd = open (tty_name, O_RDONLY | O_NOCTTY);
if (tty_fd < 0)
{
free (tty_name);
return false;
}
free (tty_name);
vt_switched = switch_to_vt (tty_fd, vt_number);
close (tty_fd);
return vt_switched;
}
#ifdef PLY_WINDOW_ENABLE_TEST
#include <stdio.h>
@ -942,14 +892,6 @@ main (int argc,
return errno;
}
if (!ply_window_take_console (window))
{
ply_save_errno ();
ply_error ("could not move console to vt %d: %m", vt_number);
ply_restore_errno ();
return errno;
}
if (!ply_window_set_mode (window, PLY_WINDOW_MODE_TEXT))
{
ply_save_errno ();

View file

@ -96,9 +96,6 @@ void ply_window_set_erase_handler (ply_window_t *window,
void *user_data);
bool ply_window_open (ply_window_t *window);
bool ply_window_take_console (ply_window_t *window);
bool ply_window_give_console (ply_window_t *window,
int vt_number);
void ply_window_close (ply_window_t *window);
bool ply_window_set_mode (ply_window_t *window,
ply_window_mode_t mode);

View file

@ -242,12 +242,7 @@ on_show_splash (state_t *state)
{
if (state->window == NULL)
{
state->window = create_window (state, 1);
if (state->window != NULL && state->console == NULL)
ply_window_take_console (state->window);
}
state->window = create_window (state, 1);
if (plymouth_should_show_default_splash (state))
show_default_splash (state);

View file

@ -492,12 +492,6 @@ main (int argc,
return errno;
}
if (!ply_window_take_console (state.window))
{
perror ("could not switch console to window vt");
return errno;
}
ply_window_attach_to_event_loop (state.window, state.loop);
ply_window_set_escape_handler (state.window,
(ply_window_escape_handler_t) on_quit, &state);