Export TMPDIR to make tmpdir.t pass.

This commit is contained in:
Daniel Nichter
2012-06-11 13:28:14 -07:00
parent 9e677a7826
commit bf2a769536
2 changed files with 4 additions and 6 deletions

View File

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

View File

@@ -41,10 +41,9 @@ cmd_ok "test ! -d $tmpdir" "rm_tmpdir removes --tmpdir"
# ########################################################################### # ###########################################################################
tempdir_test () { tempdir_test () {
new_TEMP="/tmp/tmpdir_test" local new_TEMP="/tmp/tmpdir_test"
rm -rf "$new_TEMP" [ -d "$new_TEMP" ] || mkdir "$new_TEMP"
mkdir "$new_TEMP" export TMPDIR="$new_TEMP"
local TMPDIR="$new_TEMP/"
mk_tmpdir mk_tmpdir