Sophie

Sophie

distrib > Altlinux > 4.1 > i586 > by-pkgid > afa9b7d121585084f8248b2a9be943bd > files > 4

netpbm-10.35.32-alt1.M41.1.src.rpm

--- netpbm-10.29/editor/pnmindex.sh-	2005-03-16 23:18:17 +0000
+++ netpbm-10.29/editor/pnmindex.sh	2005-10-04 16:58:55 +0000
@@ -89,11 +89,15 @@ if [ $# -eq 0 ]; then
     usage
 fi
 
-tempdir="${TMPDIR-/tmp}/pnmindex.$$"
-mkdir $tempdir || { echo "Could not create temporary file. Exiting."; exit 1;}
-chmod 700 $tempdir
-
-trap 'rm -rf $tempdir' 0 1 3 15
+exit_handler()
+{
+	local rc=$?
+	trap - EXIT
+	rm -rf -- "$tempdir"
+	exit $rc
+}
+tempdir=`mktemp -d -t pnmindex.XXXXXXXX` || exit 1
+trap exit_handler EXIT HUP INT QUIT PIPE TERM
 
 tmpfile=$tempdir/pi.tmp
 maxformat=PBM