diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2023-03-04 23:09:16 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2023-03-04 23:09:16 +0000 |
commit | 0dc00ce7069492ded283895e734db8f3713607e3 (patch) | |
tree | 8e2aaa711b350c38f5d5933bf5fbc9be08a05bdc /sbin | |
parent | 7ccd6b2cbb4dbac682a96418a05d4f21de3a4132 (diff) |
Don't whine about invalid start/end values when
starting to edit an unused GPT partition.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/fdisk/gpt.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sbin/fdisk/gpt.c b/sbin/fdisk/gpt.c index ff8bdfa96f0..7f82960ead5 100644 --- a/sbin/fdisk/gpt.c +++ b/sbin/fdisk/gpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gpt.c,v 1.84 2023/03/04 14:47:18 krw Exp $ */ +/* $OpenBSD: gpt.c,v 1.85 2023/03/04 23:09:15 krw Exp $ */ /* * Copyright (c) 2015 Markus Muller <mmu@grummel.net> * Copyright (c) 2015 Kenneth R Westerback <krw@openbsd.org> @@ -481,11 +481,13 @@ GPT_print_part(const unsigned int pn, const char *units, const int verbosity) } } - if (start > end) - printf("partition %u first LBA is > last LBA\n", pn); - if (start < gh.gh_lba_start || end > gh.gh_lba_end) - printf("partition %u extends beyond usable LBA range of %s\n", - pn, disk.dk_name); + if (uuid_is_nil(&gp[pn].gp_type, NULL) == 0) { + if (start > end) + printf("partition %u first LBA is > last LBA\n", pn); + if (start < gh.gh_lba_start || end > gh.gh_lba_end) + printf("partition %u extends beyond usable LBA range " + "of %s\n", pn, disk.dk_name); + } } int |