_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 function will be redefined in xen-hotplug-common.sh.
+sigerr() {
+ exit 1
+}
+
+
_claim_lock()
{
local lockdir="$1"
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")