Klaus Demo nginx / 78c95de
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 Igor Sysoev 11 years ago
2 changed file(s) with 18 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
248248 }
249249
250250 dir->valid_info = 0;
251 #if (NGX_HAVE_D_TYPE)
252 dir->valid_type = 1;
253 #else
254 dir->valid_type = 0;
255 #endif
256251
257252 return NGX_OK;
258253 }
266261 if (dir->de) {
267262 #if (NGX_HAVE_D_TYPE)
268263 dir->type = dir->de->d_type;
264 dir->valid_type = dir->type ? 1 : 0;
265 #else
266 dir->valid_type = 0;
269267 #endif
270268 return NGX_OK;
271269 }
199199
200200 #if (NGX_HAVE_D_TYPE)
201201
202 #if (NGX_LINUX)
203
204 /* XFS on Linux does not set dirent.d_type */
205
206 #define ngx_de_is_dir(dir) \
207 (((dir)->type) ? ((dir)->type == DT_DIR) : (S_ISDIR((dir)->info.st_mode)))
208 #define ngx_de_is_file(dir) \
209 (((dir)->type) ? ((dir)->type == DT_REG) : (S_ISREG((dir)->info.st_mode)))
210 #define ngx_de_is_link(dir) \
211 (((dir)->type) ? ((dir)->type == DT_LINK) : (S_ISLNK((dir)->info.st_mode)))
212
213 #else
214
202215 #define ngx_de_is_dir(dir) ((dir)->type == DT_DIR)
203216 #define ngx_de_is_file(dir) ((dir)->type == DT_REG)
204217 #define ngx_de_is_link(dir) ((dir)->type == DT_LINK)
218
219 #endif /* NGX_LINUX */
205220
206221 #else
207222