diff options
author | Karel Zak | 2014-09-09 15:51:19 +0200 |
---|---|---|
committer | Karel Zak | 2014-10-07 14:55:31 +0200 |
commit | 3186f4a92719ac97c6a1a12ef3a2a417a0cd9bf0 (patch) | |
tree | 13016391f6f3567a7bb52968efa6d4b42244aef9 /libfdisk/src/table.c | |
parent | libfdisk: cleanup script size= code (diff) | |
download | kernel-qcow2-util-linux-3186f4a92719ac97c6a1a12ef3a2a417a0cd9bf0.tar.gz kernel-qcow2-util-linux-3186f4a92719ac97c6a1a12ef3a2a417a0cd9bf0.tar.xz kernel-qcow2-util-linux-3186f4a92719ac97c6a1a12ef3a2a417a0cd9bf0.zip |
sfdisk: improve UI
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/table.c')
-rw-r--r-- | libfdisk/src/table.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libfdisk/src/table.c b/libfdisk/src/table.c index e5cc79aa3..efa55cd10 100644 --- a/libfdisk/src/table.c +++ b/libfdisk/src/table.c @@ -537,7 +537,9 @@ int fdisk_table_wrong_order(struct fdisk_table *tb) * @tb: table * * Add partitions from table @tb to the in-memory disk label. See - * fdisk_add_partition(), fdisk_delete_all_partitions(). + * fdisk_add_partition(), fdisk_delete_all_partitions(). The partitons + * that does not define start (or does not follow the default start) + * are ingored. * * Returns: 0 on success, <0 on error. */ @@ -554,6 +556,8 @@ int fdisk_apply_table(struct fdisk_context *cxt, struct fdisk_table *tb) fdisk_reset_iter(&itr, FDISK_ITER_FORWARD); while (tb && fdisk_table_next_partition(tb, &itr, &pa) == 0) { + if (!pa->start && !pa->start_follow_default) + continue; rc = fdisk_add_partition(cxt, pa, NULL); if (rc) break; |