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 index 417b598..36b6b67 100644 --- a/src/os/unix/ngx_files.c +++ b/src/os/unix/ngx_files.c
@@ -226,6 +226,7 @@ return NGX_ERROR; } + file->sys_offset += n; file->offset += n; written += n;