Signed-off-by: Daniel Lezcano <daniel.lezc...@linaro.org --- include/functions.sh | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/include/functions.sh b/include/functions.sh index 6702cb2..bff8e13 100644 --- a/include/functions.sh +++ b/include/functions.sh @@ -194,13 +194,20 @@ check() { return 0 } +check_file() { + local file=$1 + local dir=$2 + + check "'$file' exists" "test -f" $dir/$file +} + check_cpufreq_files() { local dirpath=$CPU_PATH/$1/cpufreq shift 1 for i in $@; do - check "$i exists" "test -f" $dirpath/$i || return 1 + check_file $i $dirpath || return 1 done return 0 @@ -211,7 +218,7 @@ check_sched_mc_files() { local dirpath=$CPU_PATH for i in $@; do - check "$i exists" "test -f" $dirpath/$i || return 1 + check_file $i $dirpath || return 1 done return 0 @@ -223,7 +230,7 @@ check_topology_files() { shift 1 for i in $@; do - check "$i exists" "test -f" $dirpath/$i || return 1 + check_file $i $dirpath || return 1 done return 0 -- 1.7.1 _______________________________________________ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev