1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

vfs_error_inject: add pwrite

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13688

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2018-11-23 10:07:29 +01:00
parent 0d15c2be6a
commit 55a82f907f

View File

@ -88,8 +88,26 @@ static int vfs_error_inject_chdir(vfs_handle_struct *handle,
return SMB_VFS_NEXT_CHDIR(handle, smb_fname);
}
static ssize_t vfs_error_inject_pwrite(vfs_handle_struct *handle,
files_struct *fsp,
const void *data,
size_t n,
off_t offset)
{
int error;
error = inject_unix_error("pwrite", handle);
if (error != 0) {
errno = error;
return -1;
}
return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
}
static struct vfs_fn_pointers vfs_error_inject_fns = {
.chdir_fn = vfs_error_inject_chdir,
.pwrite_fn = vfs_error_inject_pwrite,
};
static_decl_vfs;