summaryrefslogtreecommitdiff
path: root/src/unix/system.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2013-01-18 20:33:19 +0400
committerAndrey Nazarov <skuller@skuller.net>2013-01-18 20:33:19 +0400
commitbcaca7545462d0f61adc1260ab6084f0deb253f2 (patch)
treef7ab8b1ad3228b3643d4d31c3ac471b184e5175c /src/unix/system.c
parenta2a8d1ac66edc1e59087cae403045e60bd6f03e1 (diff)
Fix listing of POSIX symlinks.
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