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: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [Patch] fix canonicalize-existing vbd file
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Wed, 05 Dec 2007 14:12:19 +0000
Delivery-date: Wed, 05 Dec 2007 06:13:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <2C83747DEF0A9takebe_akio@xxxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acg3SNiHF1GLu6M8Edyv/QAX8io7RQ==
Thread-topic: [Xen-devel] [Patch] fix canonicalize-existing vbd file
User-agent: Microsoft-Entourage/11.3.6.070618
Do you mean to 'test -f "$file"'? A symlink will always fail 'test -f', and
$p can be a symlink.

 -- Keir

On 5/12/07 14:05, "Akio Takebe" <takebe_akio@xxxxxxxxxxxxxx> wrote:

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



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