Mercurial > hg > nginx-vendor-0-8
comparison src/core/ngx_cycle.c @ 418:ff86d646f9df NGINX_0_7_21
nginx 0.7.21
*) Changes in the ngx_http_limit_req_module.
*) Feature: the EXSLT support in the ngx_http_xslt_module.
Thanks to Denis F. Latypoff.
*) Workaround: compatibility with glibc 2.3.
Thanks to Eric Benson and Maxim Dounin.
*) Bugfix: nginx could not run on MacOSX 10.4 and earlier; the bug had
appeared in 0.7.6.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 11 Nov 2008 00:00:00 +0300 |
parents | a094317ba307 |
children | ce4f9ff90bfa |
comparison
equal
deleted
inserted
replaced
417:735cec38a814 | 418:ff86d646f9df |
---|---|
994 | 994 |
995 | 995 |
996 void | 996 void |
997 ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user) | 997 ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user) |
998 { | 998 { |
999 ssize_t n, len; | |
999 ngx_fd_t fd; | 1000 ngx_fd_t fd; |
1000 ngx_uint_t i; | 1001 ngx_uint_t i; |
1001 ngx_list_part_t *part; | 1002 ngx_list_part_t *part; |
1002 ngx_open_file_t *file; | 1003 ngx_open_file_t *file; |
1003 | 1004 |
1017 | 1018 |
1018 if (file[i].name.data == NULL) { | 1019 if (file[i].name.data == NULL) { |
1019 continue; | 1020 continue; |
1020 } | 1021 } |
1021 | 1022 |
1022 if (file[i].buffer && file[i].pos - file[i].buffer != 0) { | 1023 len = file[i].pos - file[i].buffer; |
1023 ngx_write_fd(file[i].fd, file[i].buffer, | 1024 |
1024 file[i].pos - file[i].buffer); | 1025 if (file[i].buffer && len != 0) { |
1026 | |
1027 n = ngx_write_fd(file[i].fd, file[i].buffer, len); | |
1028 | |
1029 if (n == NGX_FILE_ERROR) { | |
1030 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, | |
1031 ngx_write_fd_n " to \"%s\" failed", | |
1032 file[i].name.data); | |
1033 | |
1034 } else if (n != len) { | |
1035 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, | |
1036 ngx_write_fd_n " to \"%s\" was incomplete: %z of %uz", | |
1037 file[i].name.data, n, len); | |
1038 } | |
1039 | |
1025 file[i].pos = file[i].buffer; | 1040 file[i].pos = file[i].buffer; |
1026 } | 1041 } |
1027 | 1042 |
1028 fd = ngx_open_file(file[i].name.data, NGX_FILE_RDWR, | 1043 fd = ngx_open_file(file[i].name.data, NGX_FILE_RDWR, |
1029 NGX_FILE_CREATE_OR_OPEN|NGX_FILE_APPEND, | 1044 NGX_FILE_CREATE_OR_OPEN|NGX_FILE_APPEND, |