diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-07-16 14:01:02 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-07-16 14:01:02 +0100 |
commit | a03f180b6af09d1d7ea91666e6322ae34c09ec4b (patch) | |
tree | 1fbe83779b7023b7ddc8bc71c5ee3fb3a399b7a2 | |
parent | 975c2b7812fc2ddc291829210eea5790a03bfcc6 (diff) | |
download | xen-a03f180b6af09d1d7ea91666e6322ae34c09ec4b.tar.gz xen-a03f180b6af09d1d7ea91666e6322ae34c09ec4b.tar.bz2 xen-a03f180b6af09d1d7ea91666e6322ae34c09ec4b.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>
xen-unstable changeset: 21738:473c170bca8d
xen-unstable date: Tue Jul 06 13:10:14 2010 +0100
-rw-r--r-- | tools/hotplug/Linux/locking.sh | 8 |
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") |