Avoid file creation/deletion races in emsdk_env.sh by using a temporary file(#307)
Fixes https://github.com/emscripten-core/emscripten/issues/9090.
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
# ./emsdk_env.sh
|
||||
#
|
||||
# which won't have any effect.
|
||||
|
||||
SRC="$BASH_SOURCE"
|
||||
if [ "$SRC" = "" ]; then
|
||||
SRC="$0"
|
||||
@@ -23,7 +22,9 @@ CURDIR="$(pwd)"
|
||||
cd "$(dirname "$SRC")"
|
||||
unset SRC
|
||||
|
||||
./emsdk construct_env "$@"
|
||||
. ./emsdk_set_env.sh
|
||||
tmpfile=`mktemp` || exit 1
|
||||
./emsdk construct_env "$@" $tmpfile
|
||||
. $tmpfile
|
||||
rm -f $tmpfile
|
||||
|
||||
cd "$CURDIR"
|
||||
|
||||
Reference in New Issue
Block a user