summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-05-06 12:54:09 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-05-06 12:54:09 +0000
commitb9ee041e8f630ae2cdd0ff644d0f92c2304b9078 (patch)
tree1f2ef0101e279fb8363c3f303319eff610f90572
parent17c8c0e3af7932edb6bd4fa0fa6e32b8205d6928 (diff)
downloadalpine-conf-b9ee041e8f630ae2cdd0ff644d0f92c2304b9078.zip
improve tempdir creation
-rwxr-xr-xlibalpine.sh.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/libalpine.sh.in b/libalpine.sh.in
index add5798..ad741c0 100755
--- a/libalpine.sh.in
+++ b/libalpine.sh.in
@@ -38,9 +38,9 @@ eecho() {
init_tmpdir() {
local omask=`umask`
- local __tmpd="/tmp/$PROGRAM-${$}-`date +%s`"
+ local __tmpd="/tmp/$PROGRAM-${$}-`date +%s`-$RANDOM"
umask 077 || die "umask"
- mkdir "$__tmpd" || exit 1
+ mkdir -p "$__tmpd" || exit 1
trap "rm -fr \"$__tmpd\"; exit" 0
umask $omask
eval "$1=\"$__tmpd\""