diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-03 20:57:17 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-03 20:57:17 +0000 |
commit | d91435e4ab585b556f77e826224ad79d426bba97 (patch) | |
tree | 117821b22180dab045d232200cdcc72b1fe2364a /gcc/gccbug.in | |
parent | 4ef4358c13cdcc9e4ac0b1f5aa28ab2c0f316906 (diff) | |
download | gcc-d91435e4ab585b556f77e826224ad79d426bba97.tar.gz |
* gccbug.in: Use a temporary directory when the mktemp command is
not available.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41809 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gccbug.in')
-rwxr-xr-x | gcc/gccbug.in | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/gcc/gccbug.in b/gcc/gccbug.in index 42b52aec6b1..efa9b2f0131 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 |