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:
parent
0d15c2be6a
commit
55a82f907f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user