aboutsummaryrefslogtreecommitdiffstats
path: root/tools/hotplug
diff options
context:
space:
mode:
authorIan Jackson <Ian.Jackson@eu.citrix.com>2010-07-06 13:10:14 +0100
committerIan Jackson <Ian.Jackson@eu.citrix.com>2010-07-06 13:10:14 +0100
commit0c85cce09c6d4e7de0fa30ca7b708f798a3d8d33 (patch)
tree787a99ac2181de8486ed05cadf8fea925b169f9f /tools/hotplug
parent2157eba42a40fd8d18b8870f9a9073c41d21fb5f (diff)
downloadxen-0c85cce09c6d4e7de0fa30ca7b708f798a3d8d33.tar.gz
xen-0c85cce09c6d4e7de0fa30ca7b708f798a3d8d33.tar.bz2
xen-0c85cce09c6d4e7de0fa30ca7b708f798a3d8d33.zip
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>
Diffstat (limited to 'tools/hotplug')
-rw-r--r--tools/hotplug/Linux/locking.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh
index 6ff58e7e6c..7dbd6bef81 100644
--- a/tools/hotplug/Linux/locking.sh
+++ b/tools/hotplug/Linux/locking.sh
@@ -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")