X-Git-Url: http://git.plutz.net/?p=cgilite;a=blobdiff_plain;f=storage.sh;h=a6b6b436a947cea57b3bf684df5e8c67caa9cb66;hp=8bd1b952dc54b1a9891772b2a03a01581f0a1d74;hb=318867de22a49dc1e348cc1173ee4cdeb977d7b1;hpb=a55a4d8fb1dae783a93492c7d9b55d042791864f diff --git a/storage.sh b/storage.sh index 8bd1b95..a6b6b43 100755 --- a/storage.sh +++ b/storage.sh @@ -21,6 +21,7 @@ include_storage="$0" LOCK(){ + local lock timeout block lock="${1}.lock" timeout="${2-20}" if [ \! -w "${lock%/*}" ] || [ -e "$lock" -a \! -d "$lock" ]; then @@ -46,6 +47,7 @@ LOCK(){ } RELEASE(){ + local lock lock="${1}.lock" if [ "$(cat "$lock/pid")" = "$$" ]; then rm "$lock/pid"