OSDN Git Service

selftests/ftrace: Handle the absence of tput
authorJuerg Haefliger <juerg.haefliger@canonical.com>
Mon, 25 Feb 2019 13:14:50 +0000 (14:14 +0100)
committerShuah Khan <shuah@kernel.org>
Mon, 25 Feb 2019 14:48:01 +0000 (07:48 -0700)
commit0e27ded1159f62ab1a4e723796246bd5b1793b93
treeee1b8c0d95d430195f3cf3c1265d5b6c3dec23fb
parent4ce55a9ce18ed7649eed0e2dcb9f187891bcdf07
selftests/ftrace: Handle the absence of tput

In environments where tput is not available, we get the following
error
$ ./ftracetest: 163: [: Illegal number:
because ncolors is an empty string. Fix that by setting it to 0 if the
tput command fails.

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Juerg Haefliger <juergh@canonical.com>
Signed-off-by: Shuah Khan <shuah@kernel.org>
tools/testing/selftests/ftrace/ftracetest