svn commit: r263898 - user/marcel/mkimg

Marcel Moolenaar marcel at FreeBSD.org
Sat Mar 29 04:05:57 UTC 2014


Author: marcel
Date: Sat Mar 29 04:05:57 2014
New Revision: 263898
URL: http://svnweb.freebsd.org/changeset/base/263898

Log:
  Build this on sparc64, where we don't have LABELSECTOR nor LABELOFFSET
  defined. Improve portability by eliminating their use.

Modified:
  user/marcel/mkimg/bsd.c

Modified: user/marcel/mkimg/bsd.c
==============================================================================
--- user/marcel/mkimg/bsd.c	Sat Mar 29 03:55:58 2014	(r263897)
+++ user/marcel/mkimg/bsd.c	Sat Mar 29 04:05:57 2014	(r263898)
@@ -71,14 +71,14 @@ bsd_write(int fd, lba_t imgsz, void *boo
 		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);


More information about the svn-src-user mailing list