diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-04-11 15:17:12 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-04-11 15:17:12 +0000 |
commit | 067553ae75910d88e0e9edb968609e4e994a040c (patch) | |
tree | b79a023bcbd45be0627181a7cc0eb52e3fb6f37f | |
parent | 8aa6a723fbb32dd2093fd8971450744c0838ad8b (diff) |
Treat the list of auto-allocation partitions as a priority list and
stop auto-allocation as soon as a partition can't fit. Eliminate
the 'no space to allocate ...' messages.
-rw-r--r-- | sbin/disklabel/editor.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index 68b6b16413e..02378a6ece1 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.188 2009/04/10 21:16:51 deraadt Exp $ */ +/* $OpenBSD: editor.c,v 1.189 2009/04/11 15:17:11 krw Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com> @@ -17,7 +17,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.188 2009/04/10 21:16:51 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.189 2009/04/11 15:17:11 krw Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -548,13 +548,9 @@ editor_allocspace(struct disklabel *lp) secs = chunksize; } if (secs < ap->minsz) { + /* If this one doesn't fit, ignore subsequent ones. */ totsecs += secs; - fprintf(stderr, "no space to auto allocate %s\n", - ap->mp); - if (i == 0) - break; - else - continue; + break; } /* Everything seems ok so configure the partition. */ |