Petr Uzel wrote: > PED_MIN can evaluate its arguments twice. > > * libparted/arch/linux.c (_disk_sync_part_table): Call > _device_get_partition_range() outside PED_MIN. > --- > libparted/arch/linux.c | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c > index bc42750..b6f7e0b 100644 > --- a/libparted/arch/linux.c > +++ b/libparted/arch/linux.c > @@ -2464,11 +2464,13 @@ _disk_sync_part_table (PedDisk* disk) > PED_ASSERT(disk->dev != NULL); > int lpn; > > + unsigned int part_range = _device_get_partition_range(disk->dev); > +
That looks fine. I've adjusted the indentation above to be consistent with the rest of this function. Thanks. > /* lpn = largest partition number. */ > if (ped_disk_get_max_supported_partition_count(disk, &lpn)) > - lpn = PED_MIN(lpn, _device_get_partition_range(disk->dev)); > + lpn = PED_MIN(lpn, part_range); > else > - lpn = _device_get_partition_range(disk->dev); > + lpn = part_range; > > /* Its not possible to support largest_partnum < 0. > * largest_partnum == 0 would mean does not support partitions. _______________________________________________ parted-devel mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/parted-devel

