Build this on sparc64, where we don't have LABELSECTOR nor LABELOFFSET

defined. Improve portability by eliminating their use.
This commit is contained in:
marcel 2014-03-29 04:05:57 +00:00
parent f017f60135
commit 30dea1dbd2

4
bsd.c
View File

@ -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);