direct-io.hg

changeset 8306:a12bd9e8fdf8

Added do_without_error function, and squelch the error from mkdir when trying
to create the lock directory.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Fri Dec 09 10:50:26 2005 +0000 (2005-12-09)
parents 1aaa1abab953
children 2b09e58cb108
files tools/examples/xen-hotplug-common.sh
line diff
     1.1 --- a/tools/examples/xen-hotplug-common.sh	Fri Dec 09 10:49:29 2005 +0000
     1.2 +++ b/tools/examples/xen-hotplug-common.sh	Fri Dec 09 10:50:26 2005 +0000
     1.3 @@ -46,6 +46,10 @@ do_or_die() {
     1.4    "$@" || fatal "$@ failed"
     1.5  }
     1.6  
     1.7 +do_without_error() {
     1.8 +  "$@" 2>/dev/null || log debug "$@ failed"
     1.9 +}
    1.10 +
    1.11  sigerr() {
    1.12    fatal "$0 failed; error detected."
    1.13  }
    1.14 @@ -121,7 +125,7 @@ release_lock()
    1.15  
    1.16    while [ $retries -lt $LOCK_RETRIES ]
    1.17    do
    1.18 -    mkdir "$lockdir" && trap "release_lock $1; sigerr" ERR &&
    1.19 +    mkdir "$lockdir" 2>/dev/null && trap "release_lock $1; sigerr" ERR &&
    1.20        _update_lock_info "$lockdir" && return
    1.21  
    1.22      local new_owner=$(_lock_owner "$lockdir")