* config.guess (set_cc_for_build): Disable SC2039 ("In POSIX sh,

RANDOM is undefined").
	* Makefile (shellcheck): Don't disable SC2039 globally.
This commit is contained in:
Ben Elliston
2018-07-13 21:43:28 +10:00
parent a4b36a6939
commit 09da403c82
3 changed files with 8 additions and 1 deletions

1
config.guess vendored
View File

@ -101,6 +101,7 @@ trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0
set_cc_for_build() {
: "${TMPDIR=/tmp}"
# shellcheck disable=SC2039
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||