# HG changeset patch # User Valentin Bartenev # Date 1447776101 -10800 # Node ID 8f6d753c195386694b27760199aef0b2829fb715 # Parent 92482faf5d8a64b2dbe39d4635b93566275b1384 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. diff --git a/src/os/unix/ngx_files.c b/src/os/unix/ngx_files.c --- a/src/os/unix/ngx_files.c +++ b/src/os/unix/ngx_files.c @@ -226,6 +226,7 @@ ngx_write_file(ngx_file_t *file, u_char return NGX_ERROR; } + file->sys_offset += n; file->offset += n; written += n;