lkml.org 
[lkml]   [2015]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[for-next][PATCH 8/9] ktest: Cleanup terminal on dodie() failure
From: Josh Poimboeuf <jpoimboe@redhat.com>

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.com

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
tools/testing/ktest/ktest.pl | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index ca20ce2dc8b6..840803b3cd41 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1407,6 +1407,11 @@ sub dodie {
print " See $opt{LOG_FILE} for more info.\n";
}

+ if ($monitor_cnt) {
+ # restore terminal settings
+ system("stty $stty_orig");
+ }
+
die @_, "\n";
}

@@ -1449,7 +1454,7 @@ sub exec_console {
close($pts);

exec $console or
- dodie "Can't open console $console";
+ die "Can't open console $console";
}

sub open_console {
--
2.1.4



\
 
 \ /
  Last update: 2015-02-04 21:01    [W:0.158 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site