From: jsm28 Date: Thu, 3 May 2001 20:57:17 +0000 (+0000) Subject: * gccbug.in: Use a temporary directory when the mktemp command is X-Git-Tag: upstream/4.9.2~94604 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d91435e4ab585b556f77e826224ad79d426bba97;p=platform%2Fupstream%2Flinaro-gcc.git * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 81dc3c4..d752c56 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-05-03 Joseph S. Myers + + * gccbug.in: Use a temporary directory when the mktemp command is + not available. + 2001-05-03 Stephane Carrez * config/m68hc11/m68hc11.h (STATIC_CHAIN_REGNUM): Use soft z register 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