summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-09-16 01:34:33 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-09-16 01:34:33 +0000
commitf5b0c4fcddc711521da893f4b61dc8d0799b471b (patch)
tree20ddf6670f03573e60964e2ef78c734e5bb406e0 /sys/arch
parentcd38390abf69e4cd6d02cbc8b4959ffbd37a5b96 (diff)
Fix this so it understands disklabels.
Fix from janjaap@stack.nl. PR 1775
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/alpha/stand/boot/disk.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arch/alpha/stand/boot/disk.c b/sys/arch/alpha/stand/boot/disk.c
index 0c2c7cae7cc..641f2f87ee0 100644
--- a/sys/arch/alpha/stand/boot/disk.c
+++ b/sys/arch/alpha/stand/boot/disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disk.c,v 1.9 2001/01/25 03:50:46 todd Exp $ */
+/* $OpenBSD: disk.c,v 1.10 2001/09/16 01:34:32 art Exp $ */
/* $NetBSD: disk.c,v 1.6 1997/04/06 08:40:33 cgd Exp $ */
/*
@@ -143,14 +143,15 @@ diskopen(f, ctlr, unit, part)
if (i || cnt != DEV_BSIZE) {
printf("disk%d: error reading disk label\n", unit);
goto bad;
- } else if (lp->d_magic != DISKMAGIC) {
+ } else if (((struct disklabel *)(buf + LABELOFFSET))->d_magic !=
+ DISKMAGIC) {
/* No label at all. Fake all partitions as whole disk. */
for (i = 0; i < MAXPARTITIONS; i++) {
lp->d_partitions[part].p_offset = 0;
lp->d_partitions[part].p_size = 0x7fffffff;
}
} else {
- msg = getdisklabel(buf, lp);
+ msg = getdisklabel(buf + LABELOFFSET, lp);
if (msg) {
printf("disk%d: %s\n", unit, msg);
goto bad;