aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-08-31 11:10:21 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-08-31 11:10:21 +0100
commitc0e85ece47f9ef2bce69650a9854fe2a1ea7fb6a (patch)
treeb5f0d9fcd13e07cda62ea6ab6ba1c02c56548ce9 /tools
parentc028cc106a4abb57e9f0c199e37073a627de7eb6 (diff)
downloadxen-c0e85ece47f9ef2bce69650a9854fe2a1ea7fb6a.tar.gz
xen-c0e85ece47f9ef2bce69650a9854fe2a1ea7fb6a.tar.bz2
xen-c0e85ece47f9ef2bce69650a9854fe2a1ea7fb6a.zip
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/examples/blktap8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/examples/blktap b/tools/examples/blktap
index e4ac40b331..b3a0b63544 100644
--- a/tools/examples/blktap
+++ b/tools/examples/blktap
@@ -69,7 +69,13 @@ then
p=${p#*:}
fi
fi
-file=$(readlink -f "$p") || ebusy "$p does not exist."
+# some versions of readlink cannot be passed a regular file
+if [ -L "$p" ]; then
+ file=$(readlink -f "$p") || ebusy "$p link does not exist."
+else
+ [ -f "$p" ] || { ebusy "$p file does not exist." }
+ file="$p"
+fi
if [ "$mode" != '!' ]
then