[PATCH] reverted 1742b051d78493b90bcb801e68a2be0277bcf72f and f6=
Petr Uzel
petr.uzel at suse.cz
Tue Nov 4 14:11:54 UTC 2008
bd20573e3ecfb63f62d88c52a0870fb8851b59
---
libparted/arch/linux.c | 14 +++-----------
1 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 83e24c8..0107dd2 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2247,15 +2247,11 @@ _blkpg_remove_partition (PedDisk* disk, int n)
static int
_disk_sync_part_table (PedDisk* disk)
{
- int largest_partnum =3D ped_disk_get_last_partition_num (disk);
- if (largest_partnum <=3D 0)
- return 1;
-
- int last =3D PED_MIN (largest_partnum, 16);
+ int i;
+ int last =3D PED_MAX (ped_disk_get_last_partition_num (disk)=
, 16);
int* rets =3D ped_malloc(sizeof(int) * last);
int* errnums =3D ped_malloc(sizeof(int) * last);
int ret =3D 1;
- int i;
=20
for (i =3D 1; i <=3D last; i++) {
rets[i - 1] =3D _blkpg_remove_partition (disk, i);
@@ -2473,12 +2469,8 @@ err:
static int
_dm_reread_part_table (PedDisk* disk)
{
- int largest_partnum =3D ped_disk_get_last_partition_num (disk);
- if (largest_partnum <=3D 0)
- return 1;
-
int rc =3D 1;
- int last =3D PED_MIN (largest_partnum, 16);
+ int last =3D PED_MAX (ped_disk_get_last_partition_num (disk)=
, 16);
int i;
=20
sync();
--=20
1.6.0.2
The fix itself. I believe that the comment in the patch describes
sufficiently what it does.
More information about the parted-devel
mailing list