Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Build failures after recent chfs update
Greetings,
Recent changes to makefs make building on Mac OS X fail:
---cut---
/Users/adam/dist/src/tools/makefs/../../usr.sbin/makefs/chfs/chfs_mkfs.c:212:43:
error:
no member named 'st_mtimensec' in 'struct stat'; did you mean
'st_mtimespec'?
fdirent.mctime = htole32(node->inode->st.st_mtimensec);
^~~~~~~~~~~~
st_mtimespec
---cut---
st_mtimensec is not defined on Darwin, unless _POSIX_C_SOURCE is defined. But
if I define _POSIX_C_SOURCE (in compat), other issues show up. I propose the
following change:
diff -u -r1.3 chfs_mkfs.c
--- chfs_mkfs.c 19 Apr 2012 17:28:26 -0000 1.3
+++ chfs_mkfs.c 20 Apr 2012 12:03:20 -0000
@@ -209,7 +209,11 @@
}
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));
Also:
diff -u -r1.1 Makefile.inc
--- chfs/Makefile.inc 19 Apr 2012 15:36:06 -0000 1.1
+++ chfs/Makefile.inc 20 Apr 2012 12:06:33 -0000
@@ -5,5 +5,7 @@
CPPFLAGS+= -I${CHFS}
SRCS+= chfs_mkfs.c
+.if !defined(HOSTPROG)
LDADD+= -lz
DPADD+= ${LIBZ}
+.endif
May I commit these changes?
Kind regards,
Adam
Home |
Main Index |
Thread Index |
Old Index