mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ktest: Restore stty setting at first in dodie
@ 2023-01-20  9:16 Masami Hiramatsu (Google)
  0 siblings, 0 replies; only message in thread
From: Masami Hiramatsu (Google) @ 2023-01-20  9:16 UTC (permalink / raw)
  To: LKML; +Cc: John 'Warthog9' Hawley, Masami Hiramatsu, Steven Rostedt

From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

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().

Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
 tools/testing/ktest/ktest.pl |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index ac59999ed3de..9fb3d79b084c 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1535,6 +1535,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";
@@ -1581,11 +1586,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;
     }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-20  9:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-20  9:16 [PATCH] ktest: Restore stty setting at first in dodie Masami Hiramatsu (Google)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome