summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_flv_module.c7
-rw-r--r--src/http/modules/ngx_http_gzip_static_module.c11
-rw-r--r--src/http/modules/ngx_http_index_module.c7
-rw-r--r--src/http/modules/ngx_http_static_module.c7
-rw-r--r--src/http/modules/perl/nginx.xs8
-rw-r--r--src/http/ngx_http_script.c2
6 files changed, 17 insertions, 25 deletions
diff --git a/src/http/modules/ngx_http_flv_module.c b/src/http/modules/ngx_http_flv_module.c
index 1e8f96faf..0e190910c 100644
--- a/src/http/modules/ngx_http_flv_module.c
+++ b/src/http/modules/ngx_http_flv_module.c
@@ -111,10 +111,9 @@ ngx_http_flv_handler(ngx_http_request_t *r)
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
- rc = ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool);
-
- if (rc == NGX_ERROR) {
-
+ if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
+ != NGX_OK)
+ {
switch (of.err) {
case 0:
diff --git a/src/http/modules/ngx_http_gzip_static_module.c b/src/http/modules/ngx_http_gzip_static_module.c
index e4aaeb345..601820340 100644
--- a/src/http/modules/ngx_http_gzip_static_module.c
+++ b/src/http/modules/ngx_http_gzip_static_module.c
@@ -125,10 +125,9 @@ ngx_http_gzip_static_handler(ngx_http_request_t *r)
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
- rc = ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool);
-
- if (rc == NGX_ERROR) {
-
+ if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
+ != NGX_OK)
+ {
switch (of.err) {
case 0:
@@ -143,20 +142,18 @@ ngx_http_gzip_static_handler(ngx_http_request_t *r)
case NGX_EACCES:
level = NGX_LOG_ERR;
- rc = NGX_DECLINED;
break;
default:
level = NGX_LOG_CRIT;
- rc = NGX_DECLINED;
break;
}
ngx_log_error(level, log, of.err,
ngx_open_file_n " \"%s\" failed", path.data);
- return rc;
+ return NGX_DECLINED;
}
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", of.fd);
diff --git a/src/http/modules/ngx_http_index_module.c b/src/http/modules/ngx_http_index_module.c
index c9622835d..6bfb04565 100644
--- a/src/http/modules/ngx_http_index_module.c
+++ b/src/http/modules/ngx_http_index_module.c
@@ -214,10 +214,9 @@ ngx_http_index_handler(ngx_http_request_t *r)
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
- rc = ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool);
-
- if (rc == NGX_ERROR) {
-
+ if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
+ != NGX_OK)
+ {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, of.err,
ngx_open_file_n " \"%s\" failed", path.data);
diff --git a/src/http/modules/ngx_http_static_module.c b/src/http/modules/ngx_http_static_module.c
index cfc708916..c4e688ffb 100644
--- a/src/http/modules/ngx_http_static_module.c
+++ b/src/http/modules/ngx_http_static_module.c
@@ -102,10 +102,9 @@ ngx_http_static_handler(ngx_http_request_t *r)
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
- rc = ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool);
-
- if (rc == NGX_ERROR) {
-
+ if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
+ != NGX_OK)
+ {
switch (of.err) {
case 0:
diff --git a/src/http/modules/perl/nginx.xs b/src/http/modules/perl/nginx.xs
index 78455b951..c665446e5 100644
--- a/src/http/modules/perl/nginx.xs
+++ b/src/http/modules/perl/nginx.xs
@@ -613,7 +613,6 @@ sendfile(r, filename, offset = -1, bytes = 0)
char *filename;
int offset;
size_t bytes;
- ngx_int_t rc;
ngx_str_t path;
ngx_buf_t *b;
ngx_open_file_info_t of;
@@ -657,10 +656,9 @@ sendfile(r, filename, offset = -1, bytes = 0)
(void) ngx_cpystrn(path.data, filename, path.len + 1);
- rc = ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool);
-
- if (rc == NGX_ERROR) {
-
+ if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
+ != NGX_OK)
+ {
if (of.err == 0) {
XSRETURN_EMPTY;
}
diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c
index e30fda254..0af34e32f 100644
--- a/src/http/ngx_http_script.c
+++ b/src/http/ngx_http_script.c
@@ -982,7 +982,7 @@ ngx_http_script_file_code(ngx_http_script_engine_t *e)
of.events = clcf->open_file_cache_events;
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
- == NGX_ERROR)
+ != NGX_OK)
{
if (of.err != NGX_ENOENT && of.err != NGX_ENOTDIR) {
ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err,