]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: (gpt) update nparts_max
authorKarel Zak <kzak@redhat.com>
Thu, 6 Apr 2017 11:04:09 +0000 (13:04 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 6 Apr 2017 11:04:09 +0000 (13:04 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/gpt.c

index 36198c3bdea3c8ba38537aa39264ed1b769cb9e1..092954f11c9158b3a7e6bcd573837e43f2b86e67 100644 (file)
@@ -2678,6 +2678,9 @@ int fdisk_gpt_set_npartitions(struct fdisk_context *cxt, uint32_t entries)
        gpt_recompute_crc(gpt->pheader, gpt->ents);
        gpt_recompute_crc(gpt->bheader, gpt->ents);
 
+       /* update library info */
+       cxt->label->nparts_max = gpt_get_nentries(gpt);
+
        fdisk_info(cxt, _("Partition table length changed from %"PRIu32" to %"PRIu64"."), old, entries);
 
        fdisk_label_set_changed(cxt->label, 1);