ktest.pl: Give back console on Ctrt^C on monitor
authorSteven Rostedt <rostedt@goodmis.org>
Wed, 18 Jan 2023 21:32:13 +0000 (16:32 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Mon, 20 Feb 2023 16:52:27 +0000 (11:52 -0500)
When monitoring the console output, the stdout is being redirected to do
so. If Ctrl^C is hit during this mode, the stdout is not back to the
console, the user does not see anything they type (no echo).

Add "end_monitor" to the SIGINT interrupt handler to give back the console
on Ctrl^C.

Cc: stable@vger.kernel.org
Fixes: 9f2cdcbbb90e7 ("ktest: Give console process a dedicated tty")
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
tools/testing/ktest/ktest.pl

index 62823a4232abb584b87f710bf5c765829982179e..74801811372fd7c6b974b0d8658df3c942a8f941 100755 (executable)
@@ -4201,6 +4201,9 @@ sub send_email {
 }
 
 sub cancel_test {
+    if ($monitor_cnt) {
+       end_monitor;
+    }
     if ($email_when_canceled) {
        my $name = get_test_name;
        send_email("KTEST: Your [$name] test was cancelled",