Additional checks to see if a directory or file exists.
Signed-off-by: Lisa Nguyen lisa.nguyen@linaro.org --- cpufreq/cpufreq_sanity.sh | 3 +-- cpuhotplug/cpuhotplug_07.sh | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/cpufreq/cpufreq_sanity.sh b/cpufreq/cpufreq_sanity.sh index 6aba317..3ff42cd 100755 --- a/cpufreq/cpufreq_sanity.sh +++ b/cpufreq/cpufreq_sanity.sh @@ -35,8 +35,7 @@ check_cpufreq_sysfs_entry() {
dirpath=$CPU_PATH/cpufreq
- test -d $dirpath - if [ $? -ne 0 ]; then + if [ ! -d "$dirpath" ]; then echo "cpufreq is not supported. Skipping all cpufreq tests" skip_tests cpufreq return 0 diff --git a/cpuhotplug/cpuhotplug_07.sh b/cpuhotplug/cpuhotplug_07.sh index af7acb5..b0bd50a 100755 --- a/cpuhotplug/cpuhotplug_07.sh +++ b/cpuhotplug/cpuhotplug_07.sh @@ -39,7 +39,10 @@ check_notification() { # damn ! udevadm is buffering the output, we have to use a temp file # to retrieve the output
- rm -f $TMPFILE + if [ -f $TMPFILE ]; then + rm -f $TMPFILE + fi + $UEVENT_READER $TMPFILE & pid=$! sleep 1