summaryrefslogtreecommitdiff
path: root/sbin/disklabel/editor.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-05-13 17:02:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-05-13 17:02:47 +0000
commit9841a13319c4f3f371dbdc804ecf88402a8bcd3d (patch)
tree80dfc2f601b2d6bf62a93cb90bb187e42f24c4d8 /sbin/disklabel/editor.c
parent0389b1a7f2f606a965943a1d6a521730a9e658ff (diff)
The auto-allocator does not remember to increase the d_npartitions field
as it adds partitions. What the heck. Set it to MAXPARTITIONS. That is the new way we are treating d_npartitions everywhere in any case. It is the max a label can support. partitions which are not there mark themselves off. ok krw
Diffstat (limited to 'sbin/disklabel/editor.c')
-rw-r--r--sbin/disklabel/editor.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 6039a04d8aa..c42544a636c 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.208 2009/05/13 01:31:58 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.209 2009/05/13 17:02:46 deraadt 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.208 2009/05/13 01:31:58 krw Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.209 2009/05/13 17:02:46 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -531,6 +531,7 @@ editor_allocspace(struct disklabel *lp_org)
again:
lp = &label;
memcpy(lp, lp_org, sizeof(struct disklabel));
+ lp->d_npartitions = MAXPARTITIONS;
lastalloc = alloc_table[index].sz;
alloc = malloc(lastalloc * sizeof(struct space_allocation));
if (alloc == NULL)