Mercurial > hg > nginx
changeset 4221:3203ddb78279
Fixed another return in unix ngx_write_chain_to_file().
Previous patch missed special case for one iovec, it needs total bytes
written to be returned as well.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 21 Oct 2011 11:04:46 +0000 |
parents | 4be8dd8dd547 |
children | 2dd6c7cb211a |
files | src/os/unix/ngx_files.c |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os/unix/ngx_files.c Thu Oct 20 12:40:26 2011 +0000 +++ b/src/os/unix/ngx_files.c Fri Oct 21 11:04:46 2011 +0000 @@ -204,8 +204,15 @@ if (vec.nelts == 1) { iov = vec.elts; - return ngx_write_file(file, (u_char *) iov[0].iov_base, - iov[0].iov_len, offset); + + n = ngx_write_file(file, (u_char *) iov[0].iov_base, + iov[0].iov_len, offset); + + if (n == NGX_ERROR) { + return n; + } + + return total + n; } if (file->sys_offset != offset) {