From d36f130f3bb737e20de840cf9c8aa23aabb24f02 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 7 Feb 2012 20:13:15 +0000 Subject: [PATCH] Use flock for locking instead of hand-crafted mechanism --- wwwtools/update-nls-www | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wwwtools/update-nls-www b/wwwtools/update-nls-www index 8b46b37..354d6a2 100755 --- a/wwwtools/update-nls-www +++ b/wwwtools/update-nls-www @@ -25,10 +25,8 @@ if [ -n "$1" ]; then force=true fi -lock="$PWD/lock" -test -e "$lock" && exit 77 -trap 'rm -f $tmp $lock' EXIT ERR SIGHUP SIGINT SIGPIPE SIGTERM -touch "$lock" +( +flock -n 9 || exit 0 for branch in $active_branches; do tmp=`mktemp /tmp/$me.XXXXXX` @@ -78,3 +76,5 @@ for branch in $active_branches; do done date -u +%FT%T + +) 9>"$PWD/lock" -- 2.39.5