aboutsummaryrefslogtreecommitdiff
path: root/gcc/gccbug.in
diff options
context:
space:
mode:
authorJoseph Myers <jsm28@cam.ac.uk>2001-05-03 21:57:17 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2001-05-03 21:57:17 +0100
commitfa27606ca36122822459b32dda0ea76d3b5dd2e3 (patch)
tree117821b22180dab045d232200cdcc72b1fe2364a /gcc/gccbug.in
parent7bdf2c6522b29d1f7fe16a5c06956d923fba0800 (diff)
downloadgcc-fa27606ca36122822459b32dda0ea76d3b5dd2e3.zip
gcc-fa27606ca36122822459b32dda0ea76d3b5dd2e3.tar.gz
gcc-fa27606ca36122822459b32dda0ea76d3b5dd2e3.tar.bz2
gccbug.in: Use a temporary directory when the mktemp command is not available.
* gccbug.in: Use a temporary directory when the mktemp command is not available. From-SVN: r41809
Diffstat (limited to 'gcc/gccbug.in')
-rwxr-xr-xgcc/gccbug.in25
1 files changed, 8 insertions, 17 deletions
diff --git a/gcc/gccbug.in b/gcc/gccbug.in
index 42b52ae..efa9b2f 100755
--- a/gcc/gccbug.in
+++ b/gcc/gccbug.in
@@ -82,25 +82,16 @@ if [ @have_mktemp_command@ = yes ]; then
TEMP=`mktemp $TMPDIR/pXXXXXX` || exit 1
BAD=`mktemp $TMPDIR/pbadXXXXXX` || exit 1
REF=`mktemp $TMPDIR/pfXXXXXX` || exit 1
+ REMOVE_TEMP="rm -f $TEMP0 $TEMP $BAD $REF"
else
- TEMP0=$TMPDIR/po$$
- TEMP=$TMPDIR/p$$
- BAD=$TMPDIR/pbad$$
- REF=$TMPDIR/pf$$
- # set -C _may_ use O_EXCL, but it need not.
- set -C
- bad_temp=0
- : > $TEMP0 || bad_temp=1
- : > $TEMP || bad_temp=1
- : > $BAD || bad_temp=1
- : > $REF || bad_temp=1
- if [ $bad_temp = 1 ]; then
- rm -f $TEMP0 $TEMP $BAD $REF
- exit 1;
- fi
- set +C
+ TEMPD=$TMPDIR/pd$$
+ TEMP0=$TEMPD/po$$
+ TEMP=$TEMPD/p$$
+ BAD=$TEMPD/pbad$$
+ REF=$TEMPD/pf$$
+ mkdir $TEMPD || exit 1
+ REMOVE_TEMP="rm -rf $TEMPD"
fi
-REMOVE_TEMP="rm -f $TEMP0 $TEMP $BAD $REF"
# find a user name
if [ "$LOGNAME" = "" ]; then