XFS doesn't return the file type with opendir(), and instead only
returns it when you stat() the file itself.
c66f2602 introduced a check
to ensure that only files and symlinks were loaded, while not checking
for DT_UNKNOWN. Properly handle DT_UNKNOWN by just proceeding anyway.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
ent = readdir(dir);
for(ent = readdir(dir); ent; ent = readdir(dir)) {
#ifdef _DIRENT_HAVE_D_TYPE
- if (ent->d_type != DT_REG && ent->d_type != DT_LNK)
+ if (ent->d_type != DT_UNKNOWN &&
+ (ent->d_type != DT_REG && ent->d_type != DT_LNK))
continue;
#endif