aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2012-07-31 19:41:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 21:42:38 -0400
commitd6b09e754c23b657544f6e7f39fbf7de24c58aa2 (patch)
tree7f1128c531b80c968e503327f0d65b27cd3c3764 /tools
parent2e3ee613480563a6d5c01b57d342e65cc58c06df (diff)
fault-injection: fix failcmd.sh warning
"fault-injection: add tool to run command with failslab or fail_page_alloc" added tools/testing/fault-injection/failcmd.sh to make it easier to inject slab/page allocation failures by fault injection. failcmd.sh prints the following warning when running with arguments for command. # ./failcmd.sh echo aaa failcmd.sh: line 209: [: echo: binary operator expected aaa This warning is caused by an improper check whether at least one parameter is left after parsing command options. Fix it by testing the length of $1 instead of $@ Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/fault-injection/failcmd.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/fault-injection/failcmd.sh b/tools/testing/fault-injection/failcmd.sh
index 1776e924b202..78a9ed7fecdb 100644
--- a/tools/testing/fault-injection/failcmd.sh
+++ b/tools/testing/fault-injection/failcmd.sh
@@ -206,7 +206,7 @@ while true; do
206 esac 206 esac
207done 207done
208 208
209[ -z "$@" ] && exit 0 209[ -z "$1" ] && exit 0
210 210
211echo $oom_kill_allocating_task > /proc/sys/vm/oom_kill_allocating_task 211echo $oom_kill_allocating_task > /proc/sys/vm/oom_kill_allocating_task
212echo $task_filter > $FAULTATTR/task-filter 212echo $task_filter > $FAULTATTR/task-filter