]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Add more debugging statements
authorRay Strode <rstrode@redhat.com>
Mon, 10 Nov 2008 16:08:32 +0000 (11:08 -0500)
committerRay Strode <rstrode@redhat.com>
Mon, 10 Nov 2008 16:13:15 +0000 (11:13 -0500)
Will make it easier to catch problems.

src/libplybootsplash/ply-window.c
src/main.c

index d802eefe880ee7e3b690c928afba161bc9f8c9f9..4afbb272ee2f40f5c1bd8934fc5384556546acae 100644 (file)
@@ -493,7 +493,10 @@ ply_window_open (ply_window_t *window)
       window->vt_number = get_active_vt ();
 
       if (readlink ("/proc/self/fd/0", tty_name, sizeof (tty_name) - 1) < 0)
-        return false;
+        {
+          ply_trace ("could not read tty name of fd 0");
+          return false;
+        }
 
       window->tty_name = strdup (tty_name);
     }
@@ -503,7 +506,10 @@ ply_window_open (ply_window_t *window)
   window->tty_fd = open (window->tty_name, O_RDWR | O_NOCTTY);
 
   if (window->tty_fd < 0)
-    return false;
+    {
+      ply_trace ("could not open %s : %m", window->tty_name);
+      return false;
+    }
 
   if (!ply_window_set_unbuffered_input (window))
     ply_trace ("window '%s' will be line buffered", window->tty_name);
@@ -548,20 +554,29 @@ ply_window_close (ply_window_t *window)
 {
   window->is_open = false;
 
+  ply_trace ("restoring color palette");
   ply_window_restore_color_palette (window);
 
   if (ply_frame_buffer_device_is_open (window->frame_buffer))
-    ply_frame_buffer_close (window->frame_buffer);
+    {
+      ply_trace ("closing frame buffer");
+      ply_frame_buffer_close (window->frame_buffer);
+    }
 
   if (window->tty_fd_watch != NULL)
     {
+      ply_trace ("stop watching tty fd");
       ply_event_loop_stop_watching_fd (window->loop, window->tty_fd_watch);
       window->tty_fd_watch = NULL;
     }
 
   if (window->loop != NULL)
-    ply_event_loop_stop_watching_signal (window->loop, SIGWINCH);
+    {
+      ply_trace ("stop watching SIGWINCH signal");
+      ply_event_loop_stop_watching_signal (window->loop, SIGWINCH);
+    }
 
+  ply_trace ("setting buffered input");
   ply_window_set_buffered_input (window);
 
   close (window->tty_fd);
index 46f290a35bf86f542246f8c18ecce1825f7feed7..cb2022485a0dbc987fb3e33170b337fa41831b3a 100644 (file)
@@ -209,6 +209,8 @@ has_open_window (state_t *state)
 {
   ply_list_node_t *node;
 
+  ply_trace ("checking for open windows");
+
   node = ply_list_get_first_node (state->windows);
   while (node != NULL)
     {
@@ -220,7 +222,22 @@ has_open_window (state_t *state)
       window = ply_list_node_get_data (node);
 
       if (ply_window_is_open (window))
-        return true;
+        {
+          int fd;
+          const char *name;
+
+          fd = ply_window_get_tty_fd (window);
+
+          if (fd >= 0)
+            name = ttyname (fd);
+          else
+            name = NULL;
+
+          ply_trace ("window %s%sis open",
+                     name != NULL? name : "",
+                     name != NULL? " " : "");
+          return true;
+        }
 
       node = next_node;
     }
@@ -338,8 +355,10 @@ on_show_splash (state_t *state)
 static void
 quit_splash (state_t *state)
 {
+  ply_trace ("quiting splash");
   if (state->boot_splash != NULL)
     {
+      ply_trace ("freeing splash");
       ply_boot_splash_free (state->boot_splash);
       state->boot_splash = NULL;
     }