Merge pull request #3381 from iMichka/flock

lock.sh: suppress error output when looking for flock
This commit is contained in:
Mike McQuaid 2017-10-27 16:19:05 +01:00 committed by GitHub
commit b2e2e4b917

View File

@ -45,7 +45,7 @@ _create_lock() {
if [[ -x "$ruby" ]] && "$ruby" -e "exit(RUBY_VERSION >= '1.8.7')" if [[ -x "$ruby" ]] && "$ruby" -e "exit(RUBY_VERSION >= '1.8.7')"
then then
"$ruby" -e "File.new($lock_fd).flock(File::LOCK_EX | File::LOCK_NB) || exit(1)" "$ruby" -e "File.new($lock_fd).flock(File::LOCK_EX | File::LOCK_NB) || exit(1)"
elif [[ -x "$(which flock)" ]] elif [[ -x "$(which flock 2>/dev/null)" ]]
then then
flock -n "$lock_fd" flock -n "$lock_fd"
elif [[ -x "$python" ]] elif [[ -x "$python" ]]