replace lockfile with mkdir (#406)

This commit is contained in:
Marcin K Szczodrak
2016-08-17 12:39:06 -07:00
committed by Jonathan Hui
parent 926e44ff5c
commit 8897044464
2 changed files with 2 additions and 7 deletions
-4
View File
@@ -54,10 +54,6 @@ cd /tmp || die
[ $BUILD_TARGET != posix-32-bit ] || {
sudo apt-get install g++-multilib || die
}
[ $BUILD_TARGET != posix-distcheck ] || {
sudo apt-get install procmail || die
}
}
[ $TRAVIS_OS_NAME != osx ] || {
+2 -3
View File
@@ -108,8 +108,7 @@ trap "st=143; $do_exit" 15
lock_path="/tmp/offset"
OFFSET=0
while true; do
# using lockfile instead of mkdir since it's more portable
lockfile -0 -r 0 "${lock_path}.${OFFSET}.lock.d" > /dev/null 2>&1
mkdir "${lock_path}.${OFFSET}.lock.d" > /dev/null 2>&1
if [ $? -eq 0 ]; then
break
fi
@@ -121,7 +120,7 @@ PORT_OFFSET=$OFFSET "$@" >$log_file 2>&1
estatus=$?
# Return the offset
rm -f "${lock_path}.${OFFSET}.lock.d"
rm -rf "${lock_path}.${OFFSET}.lock.d"
if test $enable_hard_errors = no && test $estatus -eq 99; then
tweaked_estatus=1