tmpdir.sh: Use the -t flag for mktemp

This commit is contained in:
Brian Fraser fraserb@gmail.com
2012-06-11 17:07:38 -03:00
parent 8932011e7c
commit 07081d5761
2 changed files with 26 additions and 2 deletions

View File

@@ -45,7 +45,8 @@ mk_tmpdir() {
else
local tool="${0##*/}"
local pid="$$"
TMPDIR=`mktemp -d /tmp/${tool}.${pid}.XXXXXX` \
local x="$TMPDIR"
TMPDIR=`TMPDIR="$x" mktemp -d -t "${tool}.${pid}.XXXXXX"` \
|| die "Cannot make secure tmpdir"
fi
}