summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2013-12-28 23:37:00 +0000
committermiod <miod@openbsd.org>2013-12-28 23:37:00 +0000
commit99df11e0d1750310eca42e2e824c9768dd270df5 (patch)
treea9da7612002679e924dea9d32a57b40e1cd8b991
parentRemove unused variable 'token'. Spotted by deraadt@ (diff)
downloadwireguard-openbsd-99df11e0d1750310eca42e2e824c9768dd270df5.tar.xz
wireguard-openbsd-99df11e0d1750310eca42e2e824c9768dd270df5.zip
The mips partition table in the volume header uses 512-byte logical units,
not sectors; don't multiply by the sector size to get the proper disk offsets. This will let install.iso be built with the OpenBSD label at the expected location, instead of within the ffs filesystem; we had been lucky enough the area being overwritten was not in use so far.
-rw-r--r--sys/arch/sgi/sgi/disksubr.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/arch/sgi/sgi/disksubr.c b/sys/arch/sgi/sgi/disksubr.c
index 32739f3351d..e0d1b112fcb 100644
--- a/sys/arch/sgi/sgi/disksubr.c
+++ b/sys/arch/sgi/sgi/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.28 2013/10/23 11:19:32 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.29 2013/12/28 23:37:00 miod Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
@@ -134,10 +134,8 @@ readsgilabel(struct buf *bp, void (*strat)(struct buf *),
if (dlp->partitions[0].blocks == 0)
return (EINVAL);
- fsoffs = (long long)dlp->partitions[0].first *
- (dlp->dp.dp_secbytes / DEV_BSIZE);
- fsend = fsoffs + dlp->partitions[0].blocks *
- (dlp->dp.dp_secbytes / DEV_BSIZE);
+ fsoffs = (long long)dlp->partitions[0].first;
+ fsend = fsoffs + dlp->partitions[0].blocks;
/* Only came here to find the offset... */
if (partoffp) {