[parted-devel] [PATCH] When comparing use the same type of formats.

Petr Uzel petr.uzel at suse.cz
Fri Feb 20 14:25:20 UTC 2009


On Fri, Feb 20, 2009 at 03:09:27PM +0100, Jim Meyering wrote:
> I've adjusted the patch not to remove parentheses (generally good
> to keep around multi-line expressions so automatic indenters can
> do the right thing).  Of course, they're not much use right now,
> but I'm optimistic.  Also adjusted the commit log.
> 
> Petr, let me know if this is ok with you, and I'll push it.

I'm fine with this change, except the fact that I don't think that I
deserve the credits (but I don't mind ;) )

> 
> From 9685f8ffa7f39700426fd099298a228b426e4a56 Mon Sep 17 00:00:00 2001
> From: Petr Uzel <petr.uzel at suse.cz>
> Date: Fri, 20 Feb 2009 14:52:39 +0100
> Subject: [PATCH] gpt: avoid failed assertion on big-endian systems
> 
> * libparted/labels/gpt.c (_parse_header): Compute last_usable_if_grown
> not as an LE64 value but as a CPU-format one, since we're about to
> compare it to another.
> ---
>  libparted/labels/gpt.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
> index ae74123..90e5068 100644
> --- a/libparted/labels/gpt.c
> +++ b/libparted/labels/gpt.c
> @@ -676,7 +676,7 @@ _parse_header (PedDisk* disk, GuidPartitionTableHeader_t* gpt,
>  */
>     
>  	last_usable_if_grown 
> -		= PED_CPU_TO_LE64 (disk->dev->length - 2 - 
> +		= (disk->dev->length - 2 -
>  		((PedSector)(PED_LE32_TO_CPU(gpt->NumberOfPartitionEntries)) * 
>  		(PedSector)(PED_LE32_TO_CPU(gpt->SizeOfPartitionEntry)) / 
>  		disk->dev->sector_size));
> -- 
> 1.6.2.rc1.241.g7bf82
> 
> 
> _______________________________________________
> parted-devel mailing list
> parted-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/parted-devel

-- 
Best regards / s pozdravem

Petr Uzel, Packages maintainer
---------------------------------------------------------------------
SUSE LINUX, s.r.o.                          e-mail: puzel at suse.cz
Lihovarská 1060/12                          tel: +420 284 028 964
190 00 Prague 9                             fax: +420 284 028 951
Czech Republic                              http://www.suse.cz



More information about the parted-devel mailing list