summaryrefslogtreecommitdiff
path: root/src/unix/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unix/system.c')
-rw-r--r--src/unix/system.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/unix/system.c b/src/unix/system.c
index a4d341a..68e685f 100644
--- a/src/unix/system.c
+++ b/src/unix/system.c
@@ -355,7 +355,9 @@ void Sys_ListFiles_r(const char *path,
#ifdef _DIRENT_HAVE_D_TYPE
// try to avoid stat() if possible
- if (!(flags & FS_SEARCH_EXTRAINFO)) {
+ if (!(flags & FS_SEARCH_EXTRAINFO)
+ && ent->d_type != DT_UNKNOWN
+ && ent->d_type != DT_LNK) {
st.st_mode = DTTOIF(ent->d_type);
}
#endif