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

Re: [Xen-devel] [Patch] fix canonicalize-existing vbd file

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [Patch] fix canonicalize-existing vbd file
From: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
Date: Wed, 05 Dec 2007 23:05:20 +0900
Cc: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
Delivery-date: Wed, 05 Dec 2007 06:06:23 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C37C2C00.1966D%Keir.Fraser@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C37C2C00.1966D%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi, Keir

>The -e option is not available in all versions of readlink.
Thank you for your review.
How about the blew?

Signed-off-by: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>


---
diff -r 3057f813da14 tools/examples/block
--- a/tools/examples/block      Thu Nov 29 19:30:33 2007 +0000
+++ b/tools/examples/block      Wed Dec 05 22:57:56 2007 +0900
@@ -219,7 +219,8 @@ case "$command" in
       file)
         # Canonicalise the file, for sharing check comparison, and the mode
         # for ease of use here.
-        file=$(readlink -f "$p") || fatal "$p does not exist."
+        test -f "$p" || fatal "$p does not exist."
+        file=$(readlink -f "$p")
         mode=$(canonicalise_mode "$mode")
 
         claim_lock "block"

Attachment: fix_check-existing_vbd_file.patch
Description: Binary data

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