Skip to content

Commit 7dc8e24

Browse files
mhiramatrostedt
authored andcommitted
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 <[email protected]> Signed-off-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent 4e7d2a8 commit 7dc8e24

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/testing/ktest/ktest.pl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,11 @@ sub dodie {
15381538
return if ($in_die);
15391539
$in_die = 1;
15401540

1541+
if ($monitor_cnt) {
1542+
# restore terminal settings
1543+
system("stty $stty_orig");
1544+
}
1545+
15411546
my $i = $iteration;
15421547

15431548
doprint "CRITICAL FAILURE... [TEST $i] ", @_, "\n";
@@ -1584,11 +1589,6 @@ sub dodie {
15841589
"Your test started at $script_start_time has failed with:\n@_\n", $log_file);
15851590
}
15861591

1587-
if ($monitor_cnt) {
1588-
# restore terminal settings
1589-
system("stty $stty_orig");
1590-
}
1591-
15921592
if (defined($post_test)) {
15931593
run_command $post_test;
15941594
}

0 commit comments

Comments
 (0)