aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2009-07-14 09:06:05 +0200
committerAndi Kleen <ak@linux.intel.com>2009-07-14 09:06:05 +0200
commitef2399d87f88bdf3385379ccd6e953f343a24776 (patch)
tree48b3aa5507297423d7f99baca4996f83ecf7c4aa
parent78d4ff712d3872704d26bb2fb100a1e5e08a3be3 (diff)
downloadmce-test-ef2399d87f88bdf3385379ccd6e953f343a24776.tar.gz
Fix /tmp race in mce_shell.sh
And delete tmp file after shell exit Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rwxr-xr-xtools/mce_shell.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/mce_shell.sh b/tools/mce_shell.sh
index c57eddf..09800cf 100755
--- a/tools/mce_shell.sh
+++ b/tools/mce_shell.sh
@@ -19,7 +19,7 @@ else
export driver=simple
fi
-tmpfile=/tmp/mce-test-driver-shell-$$-$RANDOM
+tmpfile=$(mktemp)
trap "rm $tmpfile" EXIT
@@ -47,3 +47,4 @@ EOF
export PS1="MCE $driver: "
/bin/bash --rcfile $tmpfile
+rm $tmpfile