mirror of
https://github.com/nginx/nginx.git
synced 2025-01-24 15:16:39 -06:00
fix ngx_write_file() buf
This commit is contained in:
parent
ffcc2f4a9e
commit
c31c38b95e
@ -76,7 +76,7 @@ ngx_write_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset)
|
||||
#if (NGX_HAVE_PWRITE)
|
||||
|
||||
for ( ;; ) {
|
||||
n = pwrite(file->fd, buf, size, offset);
|
||||
n = pwrite(file->fd, buf + written, size, offset);
|
||||
|
||||
if (n == -1) {
|
||||
ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
|
||||
@ -108,7 +108,7 @@ ngx_write_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset)
|
||||
}
|
||||
|
||||
for ( ;; ) {
|
||||
n = write(file->fd, buf, size);
|
||||
n = write(file->fd, buf + written, size);
|
||||
|
||||
if (n == -1) {
|
||||
ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
|
||||
|
Loading…
Reference in New Issue
Block a user