Mercurial > hg > nginx-quic
comparison src/core/ngx_conf_file.c @ 2328:0ebecd0c3410 stable-0.6
r2303 merge:
compatibility with glibc 2.3, warn_unused_result attribute for write()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 20 Nov 2008 17:23:08 +0000 |
parents | b5263e401884 |
children | a3f062177dba |
comparison
equal
deleted
inserted
replaced
2327:be8c6159590b | 2328:0ebecd0c3410 |
---|---|
804 | 804 |
805 | 805 |
806 static void | 806 static void |
807 ngx_conf_flush_files(ngx_cycle_t *cycle) | 807 ngx_conf_flush_files(ngx_cycle_t *cycle) |
808 { | 808 { |
809 ssize_t n, len; | |
809 ngx_uint_t i; | 810 ngx_uint_t i; |
810 ngx_list_part_t *part; | 811 ngx_list_part_t *part; |
811 ngx_open_file_t *file; | 812 ngx_open_file_t *file; |
812 | 813 |
813 ngx_log_debug0(NGX_LOG_DEBUG_CORE, cycle->log, 0, "flush files"); | 814 ngx_log_debug0(NGX_LOG_DEBUG_CORE, cycle->log, 0, "flush files"); |
824 part = part->next; | 825 part = part->next; |
825 file = part->elts; | 826 file = part->elts; |
826 i = 0; | 827 i = 0; |
827 } | 828 } |
828 | 829 |
829 if (file[i].buffer == NULL || file[i].pos - file[i].buffer == 0) { | 830 len = file[i].pos - file[i].buffer; |
831 | |
832 if (file[i].buffer == NULL || len == 0) { | |
830 continue; | 833 continue; |
831 } | 834 } |
832 | 835 |
833 ngx_write_fd(file[i].fd, file[i].buffer, file[i].pos - file[i].buffer); | 836 n = ngx_write_fd(file[i].fd, file[i].buffer, len); |
837 | |
838 if (n == NGX_FILE_ERROR) { | |
839 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, | |
840 ngx_write_fd_n " to \"%s\" failed", | |
841 file[i].name.data); | |
842 | |
843 } else if (n != len) { | |
844 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, | |
845 ngx_write_fd_n " to \"%s\" was incomplete: %z of %uz", | |
846 file[i].name.data, n, len); | |
847 } | |
834 } | 848 } |
835 } | 849 } |
836 | 850 |
837 | 851 |
838 void ngx_cdecl | 852 void ngx_cdecl |