mirror of
https://github.com/nginx/nginx.git
synced 2024-12-18 21:23:36 -06:00
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:
parent
3aef20d257
commit
9ef4b63328
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user