summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/hp300/hp300/disksubr.c12
-rw-r--r--sys/arch/mac68k/mac68k/disksubr.c9
-rw-r--r--sys/arch/mvme68k/mvme68k/disksubr.c3
3 files changed, 15 insertions, 9 deletions
diff --git a/sys/arch/hp300/hp300/disksubr.c b/sys/arch/hp300/hp300/disksubr.c
index 0928c74ac90..62dfbb39dbc 100644
--- a/sys/arch/hp300/hp300/disksubr.c
+++ b/sys/arch/hp300/hp300/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.20 2006/08/17 10:34:14 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.21 2006/09/24 22:43:00 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.9 1997/04/01 03:12:13 scottr Exp $ */
/*
@@ -71,9 +71,13 @@ readdisklabel(dev, strat, lp, osdep, spoofonly)
if (lp->d_secpercyl == 0)
return ("invalid geometry");
lp->d_npartitions = RAW_PART + 1;
- if (lp->d_partitions[RAW_PART].p_size == 0)
- lp->d_partitions[RAW_PART].p_size = lp->d_secperunit;
- lp->d_partitions[RAW_PART].p_offset = 0;
+ for (i = 0; i < RAW_PART; i++) {
+ lp->d_partitions[i].p_size = 0;
+ lp->d_partitions[i].p_offset = 0;
+ }
+ if (lp->d_partitions[i].p_size == 0)
+ lp->d_partitions[i].p_size = lp->d_secperunit;
+ lp->d_partitions[i].p_offset = 0;
/* don't read the on-disk label if we are in spoofed-only mode */
if (spoofonly)
diff --git a/sys/arch/mac68k/mac68k/disksubr.c b/sys/arch/mac68k/mac68k/disksubr.c
index 3d9408dc6d9..e1f9d0f064e 100644
--- a/sys/arch/mac68k/mac68k/disksubr.c
+++ b/sys/arch/mac68k/mac68k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.30 2006/08/17 10:34:14 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.31 2006/09/24 22:43:00 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.22 1997/11/26 04:18:20 briggs Exp $ */
/*
@@ -377,12 +377,13 @@ readdisklabel(dev, strat, lp, osdep, spoofonly)
if (lp->d_secpercyl == 0)
return ("invalid geometry");
lp->d_npartitions = RAW_PART + 1;
- for (i = 0; i < MAXPARTITIONS; i++) {
+ for (i = 0; i < RAW_PART; i++) {
lp->d_partitions[i].p_size = 0;
lp->d_partitions[i].p_offset = 0;
- lp->d_partitions[i].p_fstype = FS_UNUSED;
}
- lp->d_partitions[RAW_PART].p_size = lp->d_secperunit;
+ if (lp->d_partitions[i].p_size == 0)
+ lp->d_partitions[i].p_size = lp->d_secperunit;
+ lp->d_partitions[i].p_offset = 0;
/* don't read the on-disk label if we are in spoofed-only mode */
if (spoofonly)
diff --git a/sys/arch/mvme68k/mvme68k/disksubr.c b/sys/arch/mvme68k/mvme68k/disksubr.c
index 3e80149675b..3723d086f2a 100644
--- a/sys/arch/mvme68k/mvme68k/disksubr.c
+++ b/sys/arch/mvme68k/mvme68k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.35 2006/08/17 10:34:14 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.36 2006/09/24 22:43:00 krw Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1995 Dale Rahn.
@@ -82,6 +82,7 @@ readdisklabel(dev, strat, lp, clp, spoofonly)
}
if (lp->d_partitions[i].p_size == 0)
lp->d_partitions[i].p_size = lp->d_secperunit;
+ lp->d_partitions[i].p_offset = 0;
/* don't read the on-disk label if we are in spoofed-only mode */
if (spoofonly)