Mercurial > hg > nginx
comparison src/core/ngx_conf_file.c @ 5137:f941cf265cc5
Use NGX_FILE_ERROR for handling file operations errors.
On Win32 platforms 0 is used to indicate errors in file operations, so
comparing against -1 is not portable.
This was not much of an issue in patched code, since only ngx_fd_info() test
is actually reachable on Win32 and in worst case it might result in bogus
error log entry.
Patch by Piotr Sikora.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Mon, 25 Mar 2013 15:49:11 +0000 |
parents | c37b9a17514d |
children | ea41bba49e8a |
comparison
equal
deleted
inserted
replaced
5136:88a302caca75 | 5137:f941cf265cc5 |
---|---|
131 | 131 |
132 prev = cf->conf_file; | 132 prev = cf->conf_file; |
133 | 133 |
134 cf->conf_file = &conf_file; | 134 cf->conf_file = &conf_file; |
135 | 135 |
136 if (ngx_fd_info(fd, &cf->conf_file->file.info) == -1) { | 136 if (ngx_fd_info(fd, &cf->conf_file->file.info) == NGX_FILE_ERROR) { |
137 ngx_log_error(NGX_LOG_EMERG, cf->log, ngx_errno, | 137 ngx_log_error(NGX_LOG_EMERG, cf->log, ngx_errno, |
138 ngx_fd_info_n " \"%s\" failed", filename->data); | 138 ngx_fd_info_n " \"%s\" failed", filename->data); |
139 } | 139 } |
140 | 140 |
141 cf->conf_file->buffer = &buf; | 141 cf->conf_file->buffer = &buf; |