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-changelog

[Xen-changelog] Added trap for ERR, to get better response from the scri

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Added trap for ERR, to get better response from the scripts when they are really
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 29 Nov 2005 16:44:09 +0000
Delivery-date: Tue, 29 Nov 2005 16:44:36 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 28331cd6d43af74209f48c00e6581b3e86c2c014
# Parent  e67cfb40411db6b7350fdb7567783aa412235c97
Added trap for ERR, to get better response from the scripts when they are really
broken, and add do_or_die command.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r e67cfb40411d -r 28331cd6d43a tools/examples/xen-hotplug-common.sh
--- a/tools/examples/xen-hotplug-common.sh      Tue Nov 29 14:56:16 2005
+++ b/tools/examples/xen-hotplug-common.sh      Tue Nov 29 14:56:54 2005
@@ -40,6 +40,17 @@
   xenstore_write "$XENBUS_PATH"/hotplug-status connected
 }
 
+do_or_die() {
+  "$@" || fatal "$@ failed"
+}
+
+sigerr() {
+  fatal "$0" "$@" "failed; error detected."
+}
+
+trap sigerr ERR
+
+
 ##
 # xenstore_read <path>+
 #

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Added trap for ERR, to get better response from the scripts when they are really, Xen patchbot -unstable <=