summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2014-03-29 04:05:57 +0000
committermarcel <marcel@FreeBSD.org>2014-03-29 04:05:57 +0000
commit30dea1dbd2af13c6bf6397dd72d23a7efce2754a (patch)
treeda6ce0220a54cb691a08e2f0207d168992a0470c
parentf017f60135463f7ec96f7ec33488fa034a511996 (diff)
downloadFreeBSD-src-30dea1dbd2af13c6bf6397dd72d23a7efce2754a.zip
FreeBSD-src-30dea1dbd2af13c6bf6397dd72d23a7efce2754a.tar.gz
Build this on sparc64, where we don't have LABELSECTOR nor LABELOFFSET
defined. Improve portability by eliminating their use.
-rw-r--r--bsd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bsd.c b/bsd.c
index 85d83e1..7267a56 100644
--- a/bsd.c
+++ b/bsd.c
@@ -71,14 +71,14 @@ bsd_write(int fd, lba_t imgsz, void *bootcode)
return (ENOMEM);
if (bootcode != NULL) {
memcpy(buf, bootcode, BBSIZE);
- memset(buf + LABELSECTOR * secsz, 0, secsz);
+ memset(buf + secsz, 0, secsz);
} else
memset(buf, 0, BBSIZE);
imgsz = ncyls * nheads * nsecs;
ftruncate(fd, imgsz * secsz);
- d = (void *)(buf + LABELSECTOR * secsz + LABELOFFSET);
+ d = (void *)(buf + secsz);
le32enc(&d->d_magic, DISKMAGIC);
le32enc(&d->d_secsize, secsz);
le32enc(&d->d_nsectors, nsecs);
OpenPOWER on IntegriCloud