summaryrefslogtreecommitdiffstats
path: root/usr.sbin/nginx/src/os/unix/ngx_files.h
diff options
context:
space:
mode:
authorrobert <robert@openbsd.org>2014-06-12 15:27:08 +0000
committerrobert <robert@openbsd.org>2014-06-12 15:27:08 +0000
commit48c5ce6cae7e303dfeee3a51091514ba4307bd3d (patch)
tree2c947b91869e053e1c22daedc8be6fc26be784d6 /usr.sbin/nginx/src/os/unix/ngx_files.h
parentDisable the "switch to insertion sort" optimization to avoid quadratic (diff)
downloadwireguard-openbsd-48c5ce6cae7e303dfeee3a51091514ba4307bd3d.tar.xz
wireguard-openbsd-48c5ce6cae7e303dfeee3a51091514ba4307bd3d.zip
update to 1.6.0 with official syslog support backported from the 1.7 branch
tested by several, ok sthen@
Diffstat (limited to 'usr.sbin/nginx/src/os/unix/ngx_files.h')
-rw-r--r--usr.sbin/nginx/src/os/unix/ngx_files.h26
1 files changed, 10 insertions, 16 deletions
diff --git a/usr.sbin/nginx/src/os/unix/ngx_files.h b/usr.sbin/nginx/src/os/unix/ngx_files.h
index 9c97e2bb789..a78ec961365 100644
--- a/usr.sbin/nginx/src/os/unix/ngx_files.h
+++ b/usr.sbin/nginx/src/os/unix/ngx_files.h
@@ -53,7 +53,9 @@ typedef struct {
#ifdef __CYGWIN__
+#ifndef NGX_HAVE_CASELESS_FILESYSTEM
#define NGX_HAVE_CASELESS_FILESYSTEM 1
+#endif
#define ngx_open_file(name, mode, create, access) \
open((const char *) name, mode|create|O_BINARY, access)
@@ -72,8 +74,8 @@ typedef struct {
#define NGX_FILE_RDWR O_RDWR
#define NGX_FILE_CREATE_OR_OPEN O_CREAT
#define NGX_FILE_OPEN 0
-#define NGX_FILE_TRUNCATE O_CREAT|O_TRUNC
-#define NGX_FILE_APPEND O_WRONLY|O_APPEND
+#define NGX_FILE_TRUNCATE (O_CREAT|O_TRUNC)
+#define NGX_FILE_APPEND (O_WRONLY|O_APPEND)
#define NGX_FILE_NONBLOCK O_NONBLOCK
#if (NGX_HAVE_OPENAT)
@@ -86,13 +88,16 @@ typedef struct {
#endif
#if defined(O_SEARCH)
-#define NGX_FILE_SEARCH O_SEARCH|NGX_FILE_DIRECTORY
+#define NGX_FILE_SEARCH (O_SEARCH|NGX_FILE_DIRECTORY)
#elif defined(O_EXEC)
-#define NGX_FILE_SEARCH O_EXEC|NGX_FILE_DIRECTORY
+#define NGX_FILE_SEARCH (O_EXEC|NGX_FILE_DIRECTORY)
+
+#elif (NGX_HAVE_O_PATH)
+#define NGX_FILE_SEARCH (O_PATH|O_RDONLY|NGX_FILE_DIRECTORY)
#else
-#define NGX_FILE_SEARCH O_RDONLY|NGX_FILE_DIRECTORY
+#define NGX_FILE_SEARCH (O_RDONLY|NGX_FILE_DIRECTORY)
#endif
#endif /* NGX_HAVE_OPENAT */
@@ -189,17 +194,6 @@ ngx_int_t ngx_create_file_mapping(ngx_file_mapping_t *fm);
void ngx_close_file_mapping(ngx_file_mapping_t *fm);
-#if (NGX_HAVE_CASELESS_FILESYSTEM)
-
-#define ngx_filename_cmp(s1, s2, n) strncasecmp((char *) s1, (char *) s2, n)
-
-#else
-
-#define ngx_filename_cmp ngx_memcmp
-
-#endif
-
-
#define ngx_realpath(p, r) (u_char *) realpath((char *) p, (char *) r)
#define ngx_realpath_n "realpath()"
#define ngx_getcwd(buf, size) (getcwd((char *) buf, size) != NULL)