summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-11-04 22:39:28 +1100
committerHerbert Xu <herbert@gondor.apana.org.au>2005-11-04 22:39:28 +1100
commit3c98399cdf8d376b2c1ebd9cd32ca5d8c84f3ac9 (patch)
tree581686eabf8207f594c3802b1897930113861fb6 /src
parent[JOBS] Fixed support for disabling job control (diff)
downloaddash-3c98399cdf8d376b2c1ebd9cd32ca5d8c84f3ac9.tar.gz
dash-3c98399cdf8d376b2c1ebd9cd32ca5d8c84f3ac9.zip
[HELPER] Use mktemp if tempfile is not available
tempfile(1) is Debian-specific so let's use mktemp(1) as a fallback.
Diffstat (limited to 'src')
-rw-r--r--src/mkbuiltins9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mkbuiltins b/src/mkbuiltins
index 5e2cc86..f3f91c5 100644
--- a/src/mkbuiltins
+++ b/src/mkbuiltins
@@ -35,9 +35,14 @@
 #
 #	@(#)mkbuiltins	8.2 (Berkeley) 5/4/95
 
+tempfile=tempfile
+if ! type tempfile > /dev/null 2>&1; then
+	tempfile=mktemp
+fi
+
 trap 'rm -f $temp $temp2' EXIT
-temp=$(tempfile)
-temp2=$(tempfile)
+temp=$($tempfile)
+temp2=$($tempfile)
 
 builtins=$1