diff src/os/unix/ngx_files.h @ 456:ca8f7f6cab16 NGINX_0_7_40

nginx 0.7.40 *) Feature: the "location" directive supports captures in regular expressions. *) Feature: an "alias" directive with capture references may be used inside a location given by a regular expression with captures. *) Feature: the "server_name" directive supports captures in regular expressions. *) Workaround: the ngx_http_autoindex_module did not show the trailing slash in directories on XFS filesystem; the issue had appeared in 0.7.15. Thanks to Dmitry Kuzmenko.
author Igor Sysoev <http://sysoev.ru>
date Mon, 09 Mar 2009 00:00:00 +0300
parents ff86d646f9df
children c8cfb6c462ef
line wrap: on
line diff
--- a/src/os/unix/ngx_files.h
+++ b/src/os/unix/ngx_files.h
@@ -200,10 +200,25 @@ ngx_int_t ngx_read_dir(ngx_dir_t *dir);
 
 #if (NGX_HAVE_D_TYPE)
 
+#if (NGX_LINUX)
+
+/* XFS on Linux does not set dirent.d_type */
+
+#define ngx_de_is_dir(dir)                                                   \
+    (((dir)->type) ? ((dir)->type == DT_DIR) : (S_ISDIR((dir)->info.st_mode)))
+#define ngx_de_is_file(dir)                                                  \
+    (((dir)->type) ? ((dir)->type == DT_REG) : (S_ISREG((dir)->info.st_mode)))
+#define ngx_de_is_link(dir)                                                  \
+    (((dir)->type) ? ((dir)->type == DT_LINK) : (S_ISLNK((dir)->info.st_mode)))
+
+#else
+
 #define ngx_de_is_dir(dir)       ((dir)->type == DT_DIR)
 #define ngx_de_is_file(dir)      ((dir)->type == DT_REG)
 #define ngx_de_is_link(dir)      ((dir)->type == DT_LINK)
 
+#endif /* NGX_LINUX */
+
 #else
 
 #define ngx_de_is_dir(dir)       (S_ISDIR((dir)->info.st_mode))