summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_default.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/modules/vfs_default.c')
-rw-r--r--source3/modules/vfs_default.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 4f9d90abde..b4ce9346e2 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -272,38 +272,38 @@ static ssize_t vfswrap_write(vfs_handle_struct *handle, files_struct *fsp, int f
return result;
}
-static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data,
+static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data,
size_t n, SMB_OFF_T offset)
{
ssize_t result;
#if defined(HAVE_PWRITE) || defined(HAVE_PRWITE64)
START_PROFILE_BYTES(syscall_pwrite, n);
- result = sys_pwrite(fd, data, n, offset);
+ result = sys_pwrite(fsp->fh->fd, data, n, offset);
END_PROFILE(syscall_pwrite);
if (result == -1 && errno == ESPIPE) {
/* Maintain the fiction that pipes can be sought on. */
- result = SMB_VFS_WRITE(fsp, fd, data, n);
+ result = SMB_VFS_WRITE(fsp, fsp->fh->fd, data, n);
}
#else /* HAVE_PWRITE */
SMB_OFF_T curr;
int lerrno;
- curr = SMB_VFS_LSEEK(fsp, fd, 0, SEEK_CUR);
+ curr = SMB_VFS_LSEEK(fsp, fsp->fh->fd, 0, SEEK_CUR);
if (curr == -1) {
return -1;
}
- if (SMB_VFS_LSEEK(fsp, fd, offset, SEEK_SET) == -1) {
+ if (SMB_VFS_LSEEK(fsp, fsp->fh->fd, offset, SEEK_SET) == -1) {
return -1;
}
- result = SMB_VFS_WRITE(fsp, fd, data, n);
+ result = SMB_VFS_WRITE(fsp, fsp->fh->fd, data, n);
lerrno = errno;
- SMB_VFS_LSEEK(fsp, fd, curr, SEEK_SET);
+ SMB_VFS_LSEEK(fsp, fsp->fh->fd, curr, SEEK_SET);
errno = lerrno;
#endif /* HAVE_PWRITE */