diff options
author | Valentin Bartenev <vbart@nginx.com> | 2013-03-25 15:49:11 +0000 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2013-03-25 15:49:11 +0000 |
commit | 604e18fb2c97b86b49b93b969d55003c9656f143 (patch) | |
tree | a93a3ba36cf535d7aed22f8d647e1a2e79a7fde5 /src/core/ngx_conf_file.c | |
parent | ea327f13f130be87cf3023e215d1c97b5465343f (diff) | |
download | nginx-604e18fb2c97b86b49b93b969d55003c9656f143.tar.gz nginx-604e18fb2c97b86b49b93b969d55003c9656f143.zip |
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.
Diffstat (limited to 'src/core/ngx_conf_file.c')
-rw-r--r-- | src/core/ngx_conf_file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index ed7a2ce92..a26267213 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -133,7 +133,7 @@ ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename) cf->conf_file = &conf_file; - if (ngx_fd_info(fd, &cf->conf_file->file.info) == -1) { + if (ngx_fd_info(fd, &cf->conf_file->file.info) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_EMERG, cf->log, ngx_errno, ngx_fd_info_n " \"%s\" failed", filename->data); } |