Mercurial > hg > nginx
comparison src/core/ngx_conf_file.c @ 5163:c0497468f521 stable-1.2
Merge of r5138: use of NGX_FILE_ERROR.
Use NGX_FILE_ERROR for handling file operations errors.
On Win32 platforms 0 is used to indicate errors in file operations, so
comparing against either -1 or NGX_OK 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 | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 29 Mar 2013 18:18:42 +0000 |
parents | 004af18ddb86 |
children |
comparison
equal
deleted
inserted
replaced
5162:ee9a043765ea | 5163:c0497468f521 |
---|---|
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; |