This basically just avoids clobbering a possible offset=VFS_PWRITE_APPEND_OFFSET
when calling SMB_VFS_PWRITE().
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
}
while (total < N) {
- ret = SMB_VFS_PWRITE(fsp, buffer + total, N - total,
- offset + total);
-
+ off_t pwrite_offset = offset;
+ if (offset != VFS_PWRITE_APPEND_OFFSET) {
+ pwrite_offset += total;
+ }
+ ret = SMB_VFS_PWRITE(fsp,
+ buffer + total,
+ N - total,
+ pwrite_offset);
if (ret == -1)
return -1;
if (ret == 0)