Commit 1cb9e642 authored by Josh Poimboeuf's avatar Josh Poimboeuf Committed by Steven Rostedt

ktest: Cleanup terminal on dodie() failure

If dodie() is called with the console open, restore the terminal's
original settings before dying.

Link: http://lkml.kernel.org/r/20150130025453.GB20952@treble.redhat.comSigned-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 4bf6e1fc
...@@ -1407,6 +1407,11 @@ sub dodie { ...@@ -1407,6 +1407,11 @@ sub dodie {
print " See $opt{LOG_FILE} for more info.\n"; print " See $opt{LOG_FILE} for more info.\n";
} }
if ($monitor_cnt) {
# restore terminal settings
system("stty $stty_orig");
}
die @_, "\n"; die @_, "\n";
} }
...@@ -1449,7 +1454,7 @@ sub exec_console { ...@@ -1449,7 +1454,7 @@ sub exec_console {
close($pts); close($pts);
exec $console or exec $console or
dodie "Can't open console $console"; die "Can't open console $console";
} }
sub open_console { sub open_console {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment