X-Git-Url: http://git.plutz.net/?p=cgilite;a=blobdiff_plain;f=storage.sh;h=a6b6b436a947cea57b3bf684df5e8c67caa9cb66;hp=8bd1b952dc54b1a9891772b2a03a01581f0a1d74;hb=d45f9673ac73e57aa307db2514e6233dd673b7db;hpb=a420ed0a86e9d315a868ea0b3eb0e965f110629f 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"