XFS on Linux does not set dirent.d_type,
therefore fallback to stat() if dirent.d_type is not set,
this fixes slash after directory name in ngx_http_autoindex_module;
the issue has been introduced in r2235
diff --git a/src/os/unix/ngx_files.c b/src/os/unix/ngx_files.c
index 661ecaa..1203989 100644
--- a/src/os/unix/ngx_files.c
+++ b/src/os/unix/ngx_files.c
@@ -249,11 +249,6 @@
}
dir->valid_info = 0;
-#if (NGX_HAVE_D_TYPE)
- dir->valid_type = 1;
-#else
- dir->valid_type = 0;
-#endif
return NGX_OK;
}
@@ -267,6 +262,9 @@
if (dir->de) {
#if (NGX_HAVE_D_TYPE)
dir->type = dir->de->d_type;
+ dir->valid_type = dir->type ? 1 : 0;
+#else
+ dir->valid_type = 0;
#endif
return NGX_OK;
}