WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] hotplug script: lock directory remains on error

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] hotplug script: lock directory remains on error
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Wed, 30 Jun 2010 10:18:43 +0900
Delivery-date: Tue, 29 Jun 2010 18:19:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
_release_lock should be used instead of release_lock.
Adding sigerr is extra.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r a6d5b76abdcb tools/hotplug/Linux/locking.sh
--- a/tools/hotplug/Linux/locking.sh    Tue Jun 29 18:20:14 2010 +0100
+++ b/tools/hotplug/Linux/locking.sh    Wed Jun 30 09:54:37 2010 +0900
@@ -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")
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] hotplug script: lock directory remains on error, Kouya Shimura <=