hgeditor
changeset 11266 2b440bb8a66b
parent 11190 43337076ba92
child 26781 1aee2ab0f902
--- a/hgeditor	Thu May 27 22:50:23 2010 +0300
+++ b/hgeditor	Wed May 19 18:06:35 2010 +0200
@@ -27,10 +27,10 @@
 trap "cleanup_exit" 0 # normal exit
 trap "exit 255" HUP INT QUIT ABRT TERM
 
-HGTMP="${TMPDIR-/tmp}/hgeditor.$RANDOM.$RANDOM.$RANDOM.$$"
-(umask 077 && mkdir "$HGTMP") || {
-    echo "Could not create temporary directory! Exiting." 1>&2
-    exit 1
+HGTMP=$(mktemp -d ${TMPDIR-/tmp}/hgeditor.XXXXXX)
+[ x$HGTMP != x -a -d $HGTMP ] || {
+  echo "Could not create temporary directory! Exiting." 1>&2
+  exit 1
 }
 
 (