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

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


  • To: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Acg3SNiHF1GLu6M8Edyv/QAX8io7RQ==
  • Thread-topic: [Xen-devel] [Patch] fix canonicalize-existing vbd file

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


 


Rackspace

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