summaryrefslogtreecommitdiff
path: root/support/check_forensic
diff options
context:
space:
mode:
authorJustin Erenkrantz <jerenkrantz@apache.org>2005-01-23 17:36:32 +0000
committerJustin Erenkrantz <jerenkrantz@apache.org>2005-01-23 17:36:32 +0000
commit1731589f3cb24adc3dbdef1f363b5b9f7816104a (patch)
tree61bb5918e85d9f0e0de08ae4b246f0ee2319d1ec /support/check_forensic
parent3955df151db2c1b093d02a3e06af01a3d985ce58 (diff)
downloadhttpd-1731589f3cb24adc3dbdef1f363b5b9f7816104a.tar.gz
* support/check_forensic: Fix script on platforms that do not have either
mktemp or tempfile (such as Solaris). Also tested on Darwin & FreeBSD. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@126224 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'support/check_forensic')
-rwxr-xr-xsupport/check_forensic36
1 files changed, 33 insertions, 3 deletions
diff --git a/support/check_forensic b/support/check_forensic
index a37ee897e5..3c8123fcbb 100755
--- a/support/check_forensic
+++ b/support/check_forensic
@@ -7,9 +7,39 @@
F=$1
-all=`mktemp -t fcall.XXXXXX || tempfile --prefix=fcall` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
-in=`mktemp -t fcin.XXXXXX || tempfile --prefix=fcin` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
-out=`mktemp -t fcout.XXXXXX || tempfile --prefix=fcout` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
+temp_create_method=file
+if test -f `which mktemp`; then
+ temp_create_method=mktemp
+elif test -f `which tempfile`; then
+ temp_create_method=tempfile
+fi
+
+create_temp()
+{
+ prefix=$1
+ case "$temp_create_method" in
+ file)
+ name="/tmp/$1.$$"
+ ;;
+ mktemp)
+ name=`mktemp -t $1.XXXXXX`
+ ;;
+ tempfile)
+ name=`tempfile --prefix=$1`
+ ;;
+ *)
+ echo "$0: Cannot create temporary file"
+ exit 1
+ ;;
+ esac
+}
+
+create_temp fcall
+all=$name
+create_temp fcin
+in=$name
+create_temp fcout
+out=$name
trap "rm -f -- \"$all\" \"$in\" \"$out\";" 0 1 2 3 13 15
cut -f 1 -d '|' $F > $all