From c542caa003ff36a87393435756bb7764f9d723aa Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Sat, 21 Dec 2019 13:01:01 +1100 Subject: [PATCH] =?UTF-8?q?=09*=20config.guess=20(set=5Fcc=5Ffor=5Fbuild):?= =?UTF-8?q?=20Prevent=20multiple=20calls=20by=20=09chechking=20if=20$tmp?= =?UTF-8?q?=20is=20already=20set.=20We=20can't=20check=20CC=5FFOR=5FBUILD?= =?UTF-8?q?=20as=20=09the=20user=20may=20set=20it=20externally.=20Thanks?= =?UTF-8?q?=20to=20Torbj=C3=B6rn=20Granlund=20for=20=09the=20bug=20report.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeLog | 7 +++++++ config.guess | 2 ++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9c688eb..7a7ade2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2019-12-21 Ben Elliston + + * config.guess (set_cc_for_build): Prevent multiple calls by + chechking if $tmp is already set. We can't check CC_FOR_BUILD as + the user may set it externally. Thanks to Torbjörn Granlund for + the bug report. + 2019-12-21 Torbjörn Granlund * config.guess (alpha:Linux:*:*): Guard against missing diff --git a/config.guess b/config.guess index fe242a4..95b16c7 100755 --- a/config.guess +++ b/config.guess @@ -99,6 +99,8 @@ tmp= trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||