diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2018-03-08 21:47:19 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2018-03-08 21:47:19 +0000 |
commit | 69b9070dbdfe07574e0f90e5dbd7aa835d6d8908 (patch) | |
tree | ed34dec6d9e4ff865a3b14d4fc9f7c2c5816f37b /sbin | |
parent | a50e1c07ef397af2d7a672eb9fc73835c28e1bb2 (diff) |
Instead of a SUN_CYLCHECK block in both parts of an if/else, with a
goto from one to the other, just move the logic after the if/else. One
less #ifdef. Decrements total_secs in either case.
ok otto@ as part of larger diff
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/disklabel/editor.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index cd35f24624f..0ee0744fc70 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.324 2018/03/08 21:37:14 krw Exp $ */ +/* $OpenBSD: editor.c,v 1.325 2018/03/08 21:47:18 krw Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com> @@ -619,26 +619,21 @@ again: secs = ap->maxsz; else secs = totsecs; -#ifdef SUN_CYLCHECK - goto cylinderalign; -#endif } else { secs = ap->minsz; if (xtrasecs > 0) secs += (xtrasecs / 100) * ap->rate; if (secs > ap->maxsz) secs = ap->maxsz; + } #ifdef SUN_CYLCHECK -cylinderalign: - if (lp->d_flags & D_VENDOR) { - secs = ((secs + cylsecs - 1) / cylsecs) * - cylsecs; - while (secs > totsecs) - secs -= cylsecs; - } -#endif - totsecs -= secs; + if (lp->d_flags & D_VENDOR) { + secs = ((secs + cylsecs - 1) / cylsecs) * cylsecs; + while (secs > totsecs) + secs -= cylsecs; } +#endif + totsecs -= secs; /* Find largest chunk of free space. */ chunks = free_chunks(lp); |