ftracetest: Convert exit -1 to exit $FAIL
authorMichael Ellerman <mpe@ellerman.id.au>
Mon, 30 Mar 2015 05:21:00 +0000 (16:21 +1100)
committerShuah Khan <shuahkh@osg.samsung.com>
Tue, 31 Mar 2015 16:15:46 +0000 (10:15 -0600)
POSIX says that exit takes an unsigned integer between 0 and 255, so
using -1 doesn't work on POSIX shells.

There is already a well-defined failure code, $FAIL (1), so use that.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/ftrace/test.d/00basic/basic4.tc
tools/testing/selftests/ftrace/test.d/event/event-enable.tc
tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc
tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc
tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc
tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc

index fd9c49a..aa51f6c 100644 (file)
@@ -2,4 +2,4 @@
 # description: Basic event tracing check
 test -f available_events -a -f set_event -a -d events
 # check scheduler events are available
-grep -q sched available_events && exit 0 || exit -1
\ No newline at end of file
+grep -q sched available_events && exit 0 || exit $FAIL
index 668616d..dbddb78 100644 (file)
@@ -9,7 +9,7 @@ do_reset() {
 fail() { #msg
     do_reset
     echo $1
-    exit -1
+    exit $FAIL
 }
 
 if [ ! -f set_event -o ! -d events/sched ]; then
index 655c415..ef9b95d 100644 (file)
@@ -9,7 +9,7 @@ do_reset() {
 fail() { #msg
     do_reset
     echo $1
-    exit -1
+    exit $FAIL
 }
 
 if [ ! -f set_event -o ! -d events/sched ]; then
index 4808457..af8cf01 100644 (file)
@@ -9,7 +9,7 @@ do_reset() {
 fail() { #msg
     do_reset
     echo $1
-    exit -1
+    exit $FAIL
 }
 
 if [ ! -f available_events -o ! -f set_event -o ! -d events ]; then
index 6af5f63..0ab2189 100644 (file)
@@ -17,7 +17,7 @@ do_reset() {
 fail() { # msg
     do_reset
     echo $1
-    exit -1
+    exit $FAIL
 }
 
 disable_tracing
index 2e719cb..7808336 100644 (file)
@@ -31,7 +31,7 @@ fail() { # mesg
     reset_tracer
     echo > set_ftrace_filter
     echo $1
-    exit -1
+    exit $FAIL
 }
 
 echo "Testing function tracer with profiler:"