diff options
| author | Karel Zak <kzak@redhat.com> | 2014-10-15 12:17:40 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2014-10-15 12:17:40 +0200 |
| commit | ecf40cda764496d3d1b29435ea64a65335ae0acf (patch) | |
| tree | 9ef1d00a3906fd495194b88ca5023c9729353df0 /disk-utils/sfdisk.c | |
| parent | 6311e178452fc3789a0255fe141ea598c24f3f3d (diff) | |
| download | util-linux-ecf40cda764496d3d1b29435ea64a65335ae0acf.tar.gz | |
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/sfdisk.c')
| -rw-r--r-- | disk-utils/sfdisk.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |
