diff options
author | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2023-01-20 10:16:16 +0100 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2023-02-20 17:52:27 +0100 |
commit | 7dc8e24f0e09834341f84d37433840b353d64bc8 (patch) | |
tree | 319af4fd8c46e89f6f3acea156382fe583a10044 /tools/testing/ktest | |
parent | ktest.pl: Add RUN_TIMEOUT option with default unlimited (diff) | |
download | linux-7dc8e24f0e09834341f84d37433840b353d64bc8.tar.xz linux-7dc8e24f0e09834341f84d37433840b353d64bc8.zip |
ktest: Restore stty setting at first in dodie
The do_send_email() will call die before restoring stty if sendmail
setting is not correct or sendmail is not installed. It is safer to
restore it in the beginning of dodie().
Link: https://lkml.kernel.org/r/167420617635.2988775.13045295332829029437.stgit@devnote3
Cc: John 'Warthog9' Hawley <warthog9@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/ktest')
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 822794ca4029..829f5bdfd2e4 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -1538,6 +1538,11 @@ sub dodie { return if ($in_die); $in_die = 1; + if ($monitor_cnt) { + # restore terminal settings + system("stty $stty_orig"); + } + my $i = $iteration; doprint "CRITICAL FAILURE... [TEST $i] ", @_, "\n"; @@ -1584,11 +1589,6 @@ sub dodie { "Your test started at $script_start_time has failed with:\n@_\n", $log_file); } - if ($monitor_cnt) { - # restore terminal settings - system("stty $stty_orig"); - } - if (defined($post_test)) { run_command $post_test; } |