aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLisa Nguyen <lisa.nguyen@linaro.org>2015-11-17 16:23:01 -0800
committerLisa Nguyen <lisa.nguyen@linaro.org>2016-01-19 21:04:58 -0800
commit944fd132e34276badebc277094d1cc4d709f8e41 (patch)
treedf762982b0439b437654016a3450f3059d8083ed
parentde5a846b9c835886a7b3394b2857c539e503a8dc (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-xcpuhotplug/cpuhotplug_07.sh5
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