summaryrefslogtreecommitdiff
path: root/parted
diff options
context:
space:
mode:
authorPhillip Susi <psusi@ubuntu.com>2016-05-12 21:38:51 -0400
committerPhillip Susi <psusi@ubuntu.com>2018-06-05 10:58:12 -0400
commit247e3fc6cd8bca79b7c0362886ae9b5b06ba6f8c (patch)
treec27ce4c6e2d4316b93065b1aa6268d9de78bc835 /parted
parentf3b4015e216a3733082e71ff930526f3e8bf0c26 (diff)
downloadparted-247e3fc6cd8bca79b7c0362886ae9b5b06ba6f8c.tar.gz
Fix resizepart iec unit end sector
Fix resizepart to adjust the end to be -1 sector when using iec power of 2 units so that the next partition can start immediately following the new end, just like mkpart does.
Diffstat (limited to 'parted')
-rw-r--r--parted/parted.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/parted/parted.c b/parted/parted.c
index 88f32b9..267c346 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1567,8 +1567,11 @@ do_resizepart (PedDevice** dev, PedDisk** diskp)
start = part->geom.start;
end = oldend = part->geom.end;
- if (!command_line_get_sector (_("End?"), *dev, &end, &range_end, NULL))
+ char *end_input;
+ if (!command_line_get_sector (_("End?"), *dev, &end, &range_end, &end_input))
goto error;
+ _adjust_end_if_iec(&start, &end, range_end, end_input);
+ free(end_input);
/* Do not move start of the partition */
constraint = constraint_from_start_end_fixed_start (*dev, start, range_end);
if (!ped_disk_set_partition_geom (disk, part, constraint,