summary refs log tree commit diff
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
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 '')
-rw-r--r--ChangeLog4
-rw-r--r--src/mkbuiltins9
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 9698ebb..e85b2b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-11-4  Herbert Xu <herbert@gondor.apana.org.au>
+
+	* Use mktemp if tempfile is not available.
+
 2005-10-30  Herbert Xu <herbert@gondor.apana.org.au>
 
 	* Fixed support for disabling job control.
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