summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2023-02-02 14:33:39 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2023-02-02 14:33:39 +0000
commit474c09386e838b6c09fb43f61d8ef8cdef4cc76b (patch)
tree953271b49defbc15e2d5a73d79803a45f80d056a /sbin
parentac7192b2fbb2f2b0496ec40a6ca7906a7228dfeb (diff)
Tweak restored code chunk to eliminate duplicate checks.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/disklabel/editor.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 1c32ab76448..6cc4dd9af59 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.400 2023/02/02 00:20:49 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.401 2023/02/02 14:33:38 krw Exp $ */
/*
* Copyright (c) 1997-2000 Todd C. Miller <millert@openbsd.org>
@@ -551,17 +551,15 @@ editor_allocspace(struct disklabel *lp_org)
continue;
pp = &lp_org->d_partitions[i];
psz = DL_GETPSIZE(pp);
- if (DL_GETPSIZE(pp) == 0 || pp->p_fstype == FS_UNUSED) {
+ if (psz == 0 || pp->p_fstype == FS_UNUSED) {
freeparts++;
continue;
}
pstart = DL_GETPOFFSET(pp);
pend = pstart + psz;
- if (i != RAW_PART && psz != 0 &&
- ((pstart >= starting_sector && pstart < ending_sector) ||
- (pend > starting_sector && pend <= ending_sector))) {
- resizeok = 0; /* Non-default partition found! */
- }
+ if (((pstart >= starting_sector && pstart < ending_sector) ||
+ (pend > starting_sector && pend <= ending_sector)))
+ resizeok = 0; /* Part of OBSD area is in use! */
}
alloc = NULL;