Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2012-12-14 19:24:24 +0400
committerValentin Bartenev <vbart@nginx.com>2012-12-14 19:24:24 +0400
commitfac3b341dae56adccc1ffa7e8147b3694b209381 (patch)
tree4ee591f79bd8fc94284956fe3c5f93e1ac2645d1 /src/core/ngx_conf_file.c
parente86279e9f3d06ef50c518551eb6c7aea9d0bd41d (diff)
Fixed handling of ngx_write_fd() and ngx_read_fd() errors.
The ngx_write_fd() and ngx_read_fd() functions return -1 in case of error, so the incorrect comparison with NGX_FILE_ERROR (which is 0 on windows platforms) might result in inaccurate error message in the error log. Also the ngx_errno global variable is being set only if the returned value is -1.
Diffstat (limited to 'src/core/ngx_conf_file.c')
-rw-r--r--src/core/ngx_conf_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c
index 6da2dae80..12bb5cf8a 100644
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -983,7 +983,7 @@ ngx_conf_flush_files(ngx_cycle_t *cycle)
n = ngx_write_fd(file[i].fd, file[i].buffer, len);
- if (n == NGX_FILE_ERROR) {
+ if (n == -1) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
ngx_write_fd_n " to \"%s\" failed",
file[i].name.data);