File tempfile.diff of Package gzip.6217

Index: znew.in
===================================================================
--- znew.in.orig
+++ znew.in
@@ -59,8 +59,9 @@ block=1024
 # block is the disk block size (best guess, need not be exact)
 
 warn="(does not preserve modes and timestamp)"
-tmp=${TMPDIR-/tmp}/zfoo.$$
-set -C
+dtmp=`mktemp -d -t znew.XXXXXXXX` || exit
+trap 'rm -rf $dtmp' HUP INT PIPE TERM 0
+tmp=$dtmp/znew
 echo hi > $tmp || exit
 if test -z "`(${CPMOD-cpmod} $tmp $tmp) 2>&1`"; then
   cpmod=${CPMOD-cpmod}
@@ -76,7 +77,8 @@ fi
 # check if GZIP env. variable uses -S or --suffix
 gzip -q $tmp
 ext=`echo $tmp* | sed "s|$tmp||"`
-rm -f $tmp*
+rm -f $dtmp
+trap - HUP INT PIPE TERM 0
 if test -z "$ext"; then
   echo znew: error determining gzip extension
   exit 1
openSUSE Build Service is sponsored by