Mercurial > hg > nginx
comparison src/core/ngx_conf_file.c @ 5046:f4809ba58b15 stable-1.2
Merge of r4967: ngx_write_fd() and ngx_read_fd() errors handling.
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sun, 10 Feb 2013 03:55:18 +0000 |
parents | 43b7b9572fe1 |
children | a0599b56e748 004af18ddb86 |
comparison
equal
deleted
inserted
replaced
5045:63a6b6d70826 | 5046:f4809ba58b15 |
---|---|
981 continue; | 981 continue; |
982 } | 982 } |
983 | 983 |
984 n = ngx_write_fd(file[i].fd, file[i].buffer, len); | 984 n = ngx_write_fd(file[i].fd, file[i].buffer, len); |
985 | 985 |
986 if (n == NGX_FILE_ERROR) { | 986 if (n == -1) { |
987 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, | 987 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, |
988 ngx_write_fd_n " to \"%s\" failed", | 988 ngx_write_fd_n " to \"%s\" failed", |
989 file[i].name.data); | 989 file[i].name.data); |
990 | 990 |
991 } else if (n != len) { | 991 } else if (n != len) { |