[PATCH] gpt: avoid failed assertion on big-endian systems

Petr Uzel petr.uzel at suse.cz
Fri Feb 20 13:52:39 UTC 2009


* 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




More information about the parted-devel mailing list