Module Name:    src
Committed By:   adam
Date:           Fri Apr 20 13:28:27 UTC 2012

Modified Files:
        src/usr.sbin/makefs/chfs: Makefile.inc chfs_mkfs.c

Log Message:
Fix building tools


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/makefs/chfs/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/makefs/chfs/chfs_mkfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/chfs/Makefile.inc
diff -u src/usr.sbin/makefs/chfs/Makefile.inc:1.1 src/usr.sbin/makefs/chfs/Makefile.inc:1.2
--- src/usr.sbin/makefs/chfs/Makefile.inc:1.1	Thu Apr 19 15:36:06 2012
+++ src/usr.sbin/makefs/chfs/Makefile.inc	Fri Apr 20 13:28:27 2012
@@ -5,5 +5,7 @@ CHFS=	${NETBSDSRCDIR}/sys/ufs/chfs
 CPPFLAGS+= -I${CHFS}
 
 SRCS+=	chfs_mkfs.c
+.if !defined(HOSTPROG)
 LDADD+= -lz
 DPADD+= ${LIBZ}
+.endif

Index: src/usr.sbin/makefs/chfs/chfs_mkfs.c
diff -u src/usr.sbin/makefs/chfs/chfs_mkfs.c:1.3 src/usr.sbin/makefs/chfs/chfs_mkfs.c:1.4
--- src/usr.sbin/makefs/chfs/chfs_mkfs.c:1.3	Thu Apr 19 17:28:26 2012
+++ src/usr.sbin/makefs/chfs/chfs_mkfs.c	Fri Apr 20 13:28:27 2012
@@ -209,7 +209,11 @@ write_dirent(fsinfo_t *fsopts, fsnode *n
 	}
 
 	fdirent.version = htole64(version++);
+#ifdef HAVE_STRUCT_STAT_ST_MTIMENSEC
 	fdirent.mctime = htole32(node->inode->st.st_mtimensec);
+#else
+	fdirent.mctime = htole32(node->inode->st.st_mtimespec.tv_nsec);
+#endif
 	fdirent.nsize = htole32(strlen(name));
 	fdirent.dtype = htole32(IFTOCHT(node->type & S_IFMT));
 	fdirent.name_crc = htole32(crc32(0, (uint8_t *)name, fdirent.nsize));

Reply via email to