aboutsummaryrefslogtreecommitdiff
path: root/nginx/ngx_http_js_module.c
diff options
context:
space:
mode:
authorDmitry Volyntsev <xeioex@nginx.com>2018-05-28 17:05:16 +0300
committerDmitry Volyntsev <xeioex@nginx.com>2018-05-28 17:05:16 +0300
commit19f53c211f742274c9684aee977815c2c3f17f18 (patch)
tree3f23a5fd19380376dcf8417da9abb6b16953d57c /nginx/ngx_http_js_module.c
parentb52b11cc8566137b2e06455e93467028870f8590 (diff)
downloadnjs-19f53c211f742274c9684aee977815c2c3f17f18.tar.gz
njs-19f53c211f742274c9684aee977815c2c3f17f18.zip
Fixed error logging in js_include.
Previously, ngx_log_error() was used instead of ngx_conf_log_error() in js_include directive handler. Replacing it with ngx_conf_log_error() to report the additional information about the location of the directive in the configuration file.
Diffstat (limited to 'nginx/ngx_http_js_module.c')
-rw-r--r--nginx/ngx_http_js_module.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c
index 60e8cf61..111ce852 100644
--- a/nginx/ngx_http_js_module.c
+++ b/nginx/ngx_http_js_module.c
@@ -2189,8 +2189,8 @@ ngx_http_js_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
}
if (ngx_fd_info(fd, &fi) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, ngx_errno,
- ngx_fd_info_n " \"%s\" failed", file.data);
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno,
+ ngx_fd_info_n " \"%s\" failed", file.data);
(void) ngx_close_file(fd);
return NGX_CONF_ERROR;
}
@@ -2206,25 +2206,25 @@ ngx_http_js_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
n = ngx_read_fd(fd, start, size);
if (n == -1) {
- ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
- ngx_read_fd_n " \"%s\" failed", file.data);
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno,
+ ngx_read_fd_n " \"%s\" failed", file.data);
(void) ngx_close_file(fd);
return NGX_CONF_ERROR;
}
if ((size_t) n != size) {
- ngx_log_error(NGX_LOG_ALERT, cf->log, 0,
- ngx_read_fd_n " has read only %z of %O from \"%s\"",
- n, size, file.data);
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ ngx_read_fd_n " has read only %z of %O from \"%s\"",
+ n, size, file.data);
(void) ngx_close_file(fd);
return NGX_CONF_ERROR;
}
if (ngx_close_file(fd) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
- ngx_close_file_n " %s failed", file.data);
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno,
+ ngx_close_file_n " %s failed", file.data);
}
end = start + size;