Adjusted file->sys_offset after the write() syscall.

This fixes suboptimal behavior caused by surplus lseek() for sequential writes
on systems without pwrite().  A consecutive read after write might result in an
error on systems without pread() and pwrite().

Fortunately, at the moment there are no widely used systems without these
syscalls.
This commit is contained in:
Valentin Bartenev 2015-11-17 19:01:41 +03:00
parent 3aef20d257
commit 9ef4b63328

View File

@ -226,6 +226,7 @@ ngx_write_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset)
return NGX_ERROR;
}
file->sys_offset += n;
file->offset += n;
written += n;