diff options
| author | Josh Poimboeuf <jpoimboe@redhat.com> | 2015-01-29 21:54:53 -0500 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2015-02-02 10:43:39 -0500 |
| commit | 1cb9e64298e9af6b6a8962d43abefdf0b8a635f9 (patch) | |
| tree | 49a0f48e46100d42eca707d025fd7448f333b820 /tools/testing/ktest | |
| parent | 4bf6e1fc992a19e3a1ce7798df969817467c4360 (diff) | |
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.com
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/ktest')
| -rwxr-xr-x | tools/testing/ktest/ktest.pl | 7 |
1 files changed, 6 insertions, 1 deletions
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 { | |||
| 1407 | print " See $opt{LOG_FILE} for more info.\n"; | 1407 | print " See $opt{LOG_FILE} for more info.\n"; |
| 1408 | } | 1408 | } |
| 1409 | 1409 | ||
| 1410 | if ($monitor_cnt) { | ||
| 1411 | # restore terminal settings | ||
| 1412 | system("stty $stty_orig"); | ||
| 1413 | } | ||
| 1414 | |||
| 1410 | die @_, "\n"; | 1415 | die @_, "\n"; |
| 1411 | } | 1416 | } |
| 1412 | 1417 | ||
| @@ -1449,7 +1454,7 @@ sub exec_console { | |||
| 1449 | close($pts); | 1454 | close($pts); |
| 1450 | 1455 | ||
| 1451 | exec $console or | 1456 | exec $console or |
| 1452 | dodie "Can't open console $console"; | 1457 | die "Can't open console $console"; |
| 1453 | } | 1458 | } |
| 1454 | 1459 | ||
| 1455 | sub open_console { | 1460 | sub open_console { |
