From: Valentin Bartenev Date: Tue, 17 Nov 2015 16:01:41 +0000 (+0300) Subject: Adjusted file->sys_offset after the write() syscall. X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=9ef4b63328f534a647b367be1bce3b5a159e7c32;p=nginx.git 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 417b598f7..36b6b67ca 100644 --- 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 *buf, size_t size, off_t offset) return NGX_ERROR; } + file->sys_offset += n; file->offset += n; written += n;