]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
drop take_console/give_console functions
authorRay Strode <rstrode@redhat.com>
Wed, 1 Oct 2008 18:54:27 +0000 (14:54 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 7 Oct 2008 15:29:10 +0000 (11:29 -0400)
We aren't really using them right now.

src/libplybootsplash/ply-window.c
src/libplybootsplash/ply-window.h
src/main.c
src/ply-boot-splash.c

index eaed960f724438246d87c44235df2db1a30cea0a..81e0a54d72e4d9caf1fb014bb129545c54c4ee14 100644 (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 ();
index dcbfdd8d390a34e0cabe687c331dc28c4755e851..6d04002644796fd311faf633220935df1ba67911 100644 (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);
index 7a4c452e31fd142b5f97a452498828d05302bc49..032fc807e3b4139b857525dc3aabf50952cb5744 100644 (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);
index 2e47c61f5279c6027080c0d603859e566e75d123..59b7dcda72b34b5258991983a9d3c9c6a510db28 100644 (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);