diff options
author | Lisa Nguyen <lisa.nguyen@linaro.org> | 2015-11-17 16:23:01 -0800 |
---|---|---|
committer | Lisa Nguyen <lisa.nguyen@linaro.org> | 2016-01-19 21:04:58 -0800 |
commit | 944fd132e34276badebc277094d1cc4d709f8e41 (patch) | |
tree | df762982b0439b437654016a3450f3059d8083ed | |
parent | de5a846b9c835886a7b3394b2857c539e503a8dc (diff) |
cpuhotplug: Check if the temp file exists first
cpuhotplug_07.sh uses a temp file to run the uevent_reader
program with. Check to see if the temp file exists first
before continuing. Otherwise, users may run into errors
such as these:
grep: cpuhotplug_07.tmp: No such file or directory
Signed-off-by: Lisa Nguyen <lisa.nguyen@linaro.org>
-rwxr-xr-x | cpuhotplug/cpuhotplug_07.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpuhotplug/cpuhotplug_07.sh b/cpuhotplug/cpuhotplug_07.sh index dbd7bff..97485d9 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 + touch $TMPFILE + fi + $UEVENT_READER $TMPFILE & pid=$! sleep 1 |