tools/hotplug: locking.sh script: fix lock directory remains on error bug

_release_lock should be used instead of release_lock.
sigerr is introduced so that it can be redefined by
xen-hotplug-common.sh to a version which writes error status to xenstore.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
This commit is contained in:
Ian Jackson committed 2010-07-06 13:10:14 +01:00
1 parent 2157eba42a
commit 0c85cce09c
1 file changed
+7 -1
+7 -1
View File
@@ -39,6 +39,12 @@ release_lock()
}
# This function will be redefined in xen-hotplug-common.sh.
sigerr() {
exit 1
}
_claim_lock()
{
local lockdir="$1"
@@ -47,7 +53,7 @@ _claim_lock()
while [ $retries -lt $LOCK_RETRIES ]
do
mkdir "$lockdir" 2>/dev/null && trap "release_lock $1; sigerr" ERR &&
mkdir "$lockdir" 2>/dev/null && trap "_release_lock $lockdir; sigerr" ERR &&
_update_lock_info "$lockdir" && return
local new_owner=$(_lock_owner "$lockdir")
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.