summaryrefslogtreecommitdiffstats
path: root/disk-utils/fdisk-list.c
diff options
context:
space:
mode:
authorKarel Zak2014-10-15 12:17:40 +0200
committerKarel Zak2014-10-15 12:17:40 +0200
commitecf40cda764496d3d1b29435ea64a65335ae0acf (patch)
tree9ef1d00a3906fd495194b88ca5023c9729353df0 /disk-utils/fdisk-list.c
parenttests: check for wipefs and helpers in fdisk tests (diff)
downloadkernel-qcow2-util-linux-ecf40cda764496d3d1b29435ea64a65335ae0acf.tar.gz
kernel-qcow2-util-linux-ecf40cda764496d3d1b29435ea64a65335ae0acf.tar.xz
kernel-qcow2-util-linux-ecf40cda764496d3d1b29435ea64a65335ae0acf.zip
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 <kzak@redhat.com>
Diffstat (limited to 'disk-utils/fdisk-list.c')
-rw-r--r--disk-utils/fdisk-list.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/disk-utils/fdisk-list.c b/disk-utils/fdisk-list.c
index 46d50a7f3..d0d752ef6 100644
--- a/disk-utils/fdisk-list.c
+++ b/disk-utils/fdisk-list.c
@@ -171,6 +171,8 @@ void list_disklabel(struct fdisk_context *cxt)
/* print warnings */
while (itr && fdisk_table_next_partition(tb, itr, &pa) == 0) {
+ if (!fdisk_partition_has_start(pa))
+ continue;
if (!fdisk_lba_is_phy_aligned(cxt, fdisk_partition_get_start(pa)))
fdisk_warnx(cxt, _("Partition %zu does not start on physical sector boundary."),
fdisk_partition_get_partno(pa) + 1);