diff 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
line wrap: on
line diff
--- 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
 
         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);
         }