diff options
author | 2009-06-05 09:12:25 +0000 | |
---|---|---|
committer | 2009-06-05 09:12:25 +0000 | |
commit | a7459f40a63512c30e9e3572ff416e90fa2df899 (patch) | |
tree | 3eddb688ee2d59ec2f6e7eadb9a70ac399fff2a5 | |
parent | Destroy gilles' fantasy function. (diff) | |
download | wireguard-openbsd-a7459f40a63512c30e9e3572ff416e90fa2df899.tar.xz wireguard-openbsd-a7459f40a63512c30e9e3572ff416e90fa2df899.zip |
use the right accounting for bound edges (i think)
-rw-r--r-- | sys/arch/sgi/sgi/disksubr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/arch/sgi/sgi/disksubr.c b/sys/arch/sgi/sgi/disksubr.c index 4be24dee9c4..481fa2df5fc 100644 --- a/sys/arch/sgi/sgi/disksubr.c +++ b/sys/arch/sgi/sgi/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.14 2009/06/04 21:13:02 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.15 2009/06/05 09:12:25 deraadt Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -117,7 +117,7 @@ readsgilabel(struct buf *bp, void (*strat)(struct buf *), char *msg = NULL; int i, *p, cs = 0; int fsoffs = 0; - u_int fslen; + u_int fsend; int offset; if (partoffp) @@ -143,7 +143,7 @@ readsgilabel(struct buf *bp, void (*strat)(struct buf *), goto done; } fsoffs = dlp->partitions[0].first * (dlp->dp.dp_secbytes / DEV_BSIZE); - fslen = dlp->partitions[0].blocks * (dlp->dp.dp_secbytes / DEV_BSIZE); + fsend = fsoffs + dlp->partitions[0].blocks * (dlp->dp.dp_secbytes / DEV_BSIZE); /* * If the disklabel is about to be written to disk, don't modify it! @@ -191,8 +191,8 @@ readsgilabel(struct buf *bp, void (*strat)(struct buf *), } } - DL_GETBSTART(lp, fsoffs); - DL_GETBSIZE(lp, fsoffs + fslen); + DL_SETBSTART(lp, fsoffs); + DL_SETBEND(lp, fsend); lp->d_version = 1; lp->d_flags = D_VENDOR; lp->d_checksum = 0; @@ -212,7 +212,7 @@ finished: goto done; } - return checkdisklabel(bp->b_data + offset, lp, fsoffs, fsoffs + fslen); + return checkdisklabel(bp->b_data + offset, lp, fsoffs, fsend); done: return (msg); |