In FreeBSD 12 (see: https://reviews.freebsd.org/rS318736), the layout
of struct dirent changed to allow for 64-bit inodes and a few other
changes. Update our struct min_direct to accommodate, to allow our
readdir() results to be accurate. Without this, readdir() can yield
garbage entries, due to the mismatch in the structure definitions.
Change-Id: I36c2bf1f35b4d1ab61a2b4d51da7514827b3551b
Reviewed-on: https://gerrit.openafs.org/13854
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
uint16_t d_reclen; /* length of this record */
uint16_t d_namlen; /* length of string in d_name */
uint8_t d_type; /* file type, see below */
+#elif defined(AFS_FBSD120_ENV)
+ /* FreeBSD 12.0 moved to 64-bit inodes and bumped d_namlen to 16 bits. */
+ ino_t d_fileno;
+ off_t d_off;
+ u_short d_reclen;
+ u_char d_type;
+ u_char d_pad0;
+ u_short d_namlen;
+ u_short d_pad1;
#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
afs_uint32 d_fileno;
u_short d_reclen;
#endif /* AFS_SUN5_ENV */
#ifndef AFS_SGI53_ENV
struct min_direct sdirEntry;
+ memset(&sdirEntry, 0, sizeof(sdirEntry));
#endif /* AFS_SGI53_ENV */
AFS_STATCNT(afs_readdir_move);