]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: (resize) avoid redundant error on partnum failure
authorKarel Zak <kzak@redhat.com>
Wed, 10 Jun 2026 08:52:44 +0000 (10:52 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 10 Jun 2026 08:52:44 +0000 (10:52 +0200)
fdisk_ask_partnum() already prints its own diagnostics on failure,
so go directly to 'out' instead of 'err' which would print a
redundant "Could not resize partition" message with a meaningless
partition number.

Also removes the need for the i=0 initialization from the previous
commit, since 'i' is no longer used on the fdisk_ask_partnum()
error path.

Addresses: https://github.com/util-linux/util-linux/pull/4394
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/fdisk.c

index a593487cacdde60cbffde87aed9f2600196636b3..1fc112c05757fa61384da80d180e43f2297b82c1 100644 (file)
@@ -691,7 +691,7 @@ void resize_partition(struct fdisk_context *cxt)
 
        rc = fdisk_ask_partnum(cxt, &i, FALSE);
        if (rc)
-               goto err;
+               goto out;
 
        rc = fdisk_partition_get_max_size(cxt, i, &max_size);
        if (rc)