From ecf40cda764496d3d1b29435ea64a65335ae0acf Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 15 Oct 2014 12:17:40 +0200 Subject: libfdisk: make it possible to use zero for size and start The zero may be valid size and start of the partition. This patch introduces: fdisk_partition_has_start() fdisk_partition_has_size() fdisk_partition_unset_size() fdisk_partition_unset_start() to make it possible to work with zero. The feature is internally implemented by magic constant ((type) -1) for undefined sizes and offsets. Signed-off-by: Karel Zak --- disk-utils/sfdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'disk-utils/sfdisk.c') diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c index 68df57c0d5..821b5ed15d 100644 --- a/disk-utils/sfdisk.c +++ b/disk-utils/sfdisk.c @@ -1230,7 +1230,7 @@ static int command_fdisk(struct sfdisk *sf, int argc, char **argv) assert(pa); - if (!fdisk_partition_get_start(pa) && + if (!fdisk_partition_has_start(pa) && !fdisk_partition_start_is_default(pa)) { fdisk_info(sf->cxt, _("Ignore partition %zu"), next_partno + 1); continue; -- cgit 1.2.3-korg