ia64/xen-unstable

changeset 15813:577313e3c0a6

Fix blktap script for versions of readlink command that do not handle
regular files.
Signed-off-by: Ben Guthro <bguthro@virtualiron.com>
Signed-off-by: Josh Nicholas <jnicholas@virtualiron.com>
author kfraser@localhost.localdomain
date Fri Aug 31 11:10:21 2007 +0100 (2007-08-31)
parents 86a154e1ef5d
children 0f196e11a143
files tools/examples/blktap
line diff
     1.1 --- a/tools/examples/blktap	Fri Aug 31 11:06:22 2007 +0100
     1.2 +++ b/tools/examples/blktap	Fri Aug 31 11:10:21 2007 +0100
     1.3 @@ -69,7 +69,13 @@ then
     1.4          p=${p#*:}
     1.5      fi
     1.6  fi
     1.7 -file=$(readlink -f "$p") || ebusy "$p does not exist."
     1.8 +# some versions of readlink cannot be passed a regular file
     1.9 +if [ -L "$p" ]; then
    1.10 +    file=$(readlink -f "$p") || ebusy "$p link does not exist."
    1.11 +else
    1.12 +    [ -f "$p" ] || { ebusy "$p file does not exist." }
    1.13 +    file="$p"
    1.14 +fi
    1.15  
    1.16  if [ "$mode" != '!' ] 
    1.17  then