]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
ply-terminal: Log when terminal input gets enabled/disabled
authorRay Strode <rstrode@redhat.com>
Sat, 30 Dec 2023 13:53:03 +0000 (08:53 -0500)
committerRay Strode <halfline@gmail.com>
Sat, 30 Dec 2023 14:05:08 +0000 (14:05 +0000)
We're currently seeing a bug where it seems like the terminal might
be getting intermittently disabled.

This commit adds some logging to confirm or rule out that possibility.

src/libply-splash-core/ply-terminal.c

index 2638b2df5c9d3a4c837f978338db430747e49c88..7afdb7542fa064b29b97f65d56b906d45216f414 100644 (file)
@@ -241,6 +241,9 @@ ply_terminal_set_unbuffered_input (ply_terminal_t *terminal)
 
         ply_terminal_unlock (terminal);
 
+        if (terminal->is_disabled)
+                ply_trace ("terminal input is getting enabled in unbuffered mode");
+
         terminal->is_disabled = false;
 
         if (ply_terminal_is_vt (terminal))
@@ -276,6 +279,9 @@ ply_terminal_set_buffered_input (ply_terminal_t *terminal)
 {
         struct termios term_attributes;
 
+        if (terminal->is_disabled)
+                ply_trace ("terminal input is getting enabled in buffered mode");
+
         terminal->is_disabled = false;
 
         if (ply_terminal_is_vt (terminal))
@@ -324,6 +330,10 @@ ply_terminal_set_buffered_input (ply_terminal_t *terminal)
 bool
 ply_terminal_set_disabled_input (ply_terminal_t *terminal)
 {
+        if (!terminal->is_disabled)
+                ply_trace ("terminal input is getting disabled from %s mode",
+                           terminal->is_unbuffered? "unbuffered" : "buffered");
+
         terminal->is_disabled = true;
 
         if (ply_terminal_is_vt (terminal))