[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Fix blktap script for versions of readlink command that do not handle



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1188555021 -3600
# Node ID 577313e3c0a6681e97a06088d57484246cbc9664
# Parent  86a154e1ef5d404dd0d6577a03e913e0829462f3
Fix blktap script for versions of readlink command that do not handle
regular files.
Signed-off-by: Ben Guthro <bguthro@xxxxxxxxxxxxxxx>
Signed-off-by: Josh Nicholas <jnicholas@xxxxxxxxxxxxxxx>
---
 tools/examples/blktap |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

diff -r 86a154e1ef5d -r 577313e3c0a6 tools/examples/blktap
--- a/tools/examples/blktap     Fri Aug 31 11:06:22 2007 +0100
+++ b/tools/examples/blktap     Fri Aug 31 11:10:21 2007 +0100
@@ -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

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.