Mercurial > hg > nginx-quic
comparison src/os/unix/ngx_files.c @ 2550:5e87ddb4764f
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
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 06 Mar 2009 13:01:21 +0000 |
parents | 1adec90a0e46 |
children | ceef364208c8 |
comparison
equal
deleted
inserted
replaced
2549:2d34fba7cf06 | 2550:5e87ddb4764f |
---|---|
247 if (dir->dir == NULL) { | 247 if (dir->dir == NULL) { |
248 return NGX_ERROR; | 248 return NGX_ERROR; |
249 } | 249 } |
250 | 250 |
251 dir->valid_info = 0; | 251 dir->valid_info = 0; |
252 #if (NGX_HAVE_D_TYPE) | |
253 dir->valid_type = 1; | |
254 #else | |
255 dir->valid_type = 0; | |
256 #endif | |
257 | 252 |
258 return NGX_OK; | 253 return NGX_OK; |
259 } | 254 } |
260 | 255 |
261 | 256 |
265 dir->de = readdir(dir->dir); | 260 dir->de = readdir(dir->dir); |
266 | 261 |
267 if (dir->de) { | 262 if (dir->de) { |
268 #if (NGX_HAVE_D_TYPE) | 263 #if (NGX_HAVE_D_TYPE) |
269 dir->type = dir->de->d_type; | 264 dir->type = dir->de->d_type; |
265 dir->valid_type = dir->type ? 1 : 0; | |
266 #else | |
267 dir->valid_type = 0; | |
270 #endif | 268 #endif |
271 return NGX_OK; | 269 return NGX_OK; |
272 } | 270 } |
273 | 271 |
274 return NGX_ERROR; | 272 return NGX_ERROR; |