From fe1cb8c3acb6a7e12c10b4bd70411ebf5b005a7e Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Thu, 18 Jan 2007 19:52:18 +0000 Subject: [PATCH] rename mode to access --- src/core/ngx_file.c | 6 +++--- src/core/ngx_file.h | 4 ++-- src/http/ngx_http_request_body.c | 6 +++--- src/os/unix/ngx_files.c | 5 +++-- src/os/unix/ngx_files.h | 2 +- src/os/win32/ngx_files.h | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c index 3efa90093..2c365a8bd 100644 --- a/src/core/ngx_file.c +++ b/src/core/ngx_file.c @@ -19,7 +19,7 @@ ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain) if (tf->file.fd == NGX_INVALID_FILE) { rc = ngx_create_temp_file(&tf->file, tf->path, tf->pool, - tf->persistent, tf->mode); + tf->persistent, tf->access); if (rc == NGX_ERROR || rc == NGX_AGAIN) { return rc; @@ -37,7 +37,7 @@ ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain) ngx_int_t ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool, - ngx_uint_t persistent, ngx_uint_t mode) + ngx_uint_t persistent, ngx_uint_t access) { ngx_err_t err; ngx_atomic_uint_t n; @@ -72,7 +72,7 @@ ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool, return NGX_ERROR; } - file->fd = ngx_open_tempfile(file->name.data, persistent, mode); + file->fd = ngx_open_tempfile(file->name.data, persistent, access); ngx_log_debug1(NGX_LOG_DEBUG_CORE, file->log, 0, "temp fd:%d", file->fd); diff --git a/src/core/ngx_file.h b/src/core/ngx_file.h index 71c993175..f8107ae8c 100644 --- a/src/core/ngx_file.h +++ b/src/core/ngx_file.h @@ -49,7 +49,7 @@ typedef struct { ngx_pool_t *pool; char *warn; - ngx_uint_t mode; + ngx_uint_t access; unsigned log_level:8; unsigned persistent:1; @@ -76,7 +76,7 @@ struct ngx_tree_ctx_s { ssize_t ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain); ngx_int_t ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, - ngx_pool_t *pool, ngx_uint_t persistent,ngx_uint_t mode); + ngx_pool_t *pool, ngx_uint_t persistent,ngx_uint_t access); void ngx_create_hashed_filename(ngx_file_t *file, ngx_path_t *path); ngx_int_t ngx_create_path(ngx_file_t *file, ngx_path_t *path); ngx_err_t ngx_create_full_path(u_char *dir, ngx_uint_t access); diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c index f5aa2721a..f5f827511 100644 --- a/src/http/ngx_http_request_body.c +++ b/src/http/ngx_http_request_body.c @@ -74,13 +74,13 @@ ngx_http_read_client_request_body(ngx_http_request_t *r, tf->persistent = r->request_body_in_persistent_file; if (r->request_body_file_group_access) { - tf->mode = 0660; + tf->access = 0660; } rb->temp_file = tf; if (ngx_create_temp_file(&tf->file, tf->path, tf->pool, - tf->persistent, tf->mode) + tf->persistent, tf->access) != NGX_OK) { return NGX_HTTP_INTERNAL_SERVER_ERROR; @@ -400,7 +400,7 @@ ngx_http_write_request_body(ngx_http_request_t *r, ngx_chain_t *body) tf->persistent = r->request_body_in_persistent_file; if (r->request_body_file_group_access) { - tf->mode = 0660; + tf->access = 0660; } rb->temp_file = tf; diff --git a/src/os/unix/ngx_files.c b/src/os/unix/ngx_files.c index 50db532b6..a091b9b77 100644 --- a/src/os/unix/ngx_files.c +++ b/src/os/unix/ngx_files.c @@ -112,11 +112,12 @@ ngx_write_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset) ngx_fd_t -ngx_open_tempfile(u_char *name, ngx_uint_t persistent, ngx_uint_t mode) +ngx_open_tempfile(u_char *name, ngx_uint_t persistent, ngx_uint_t access) { ngx_fd_t fd; - fd = open((const char *) name, O_CREAT|O_EXCL|O_RDWR, mode ? mode : 0600); + fd = open((const char *) name, O_CREAT|O_EXCL|O_RDWR, + access ? access : 0600); if (fd != -1 && !persistent) { unlink((const char *) name); diff --git a/src/os/unix/ngx_files.h b/src/os/unix/ngx_files.h index 72d3461a8..1e98fc081 100644 --- a/src/os/unix/ngx_files.h +++ b/src/os/unix/ngx_files.h @@ -38,7 +38,7 @@ ngx_fd_t ngx_open_tempfile(u_char *name, ngx_uint_t persistent, - ngx_uint_t mode); + ngx_uint_t access); #define ngx_open_tempfile_n "open()" diff --git a/src/os/win32/ngx_files.h b/src/os/win32/ngx_files.h index 5a171f58f..1223d8e62 100644 --- a/src/os/win32/ngx_files.h +++ b/src/os/win32/ngx_files.h @@ -48,7 +48,7 @@ ngx_int_t ngx_file_append_mode(ngx_fd_t fd); #define ngx_file_append_mode_n "SetFilePointer()" -#define ngx_open_tempfile(name, persistent, mode) \ +#define ngx_open_tempfile(name, persistent, access) \ CreateFile((const char *) name, \ GENERIC_READ|GENERIC_WRITE, \ FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, \