diff options
author | Jeremy Allison <jra@samba.org> | 2020-05-07 12:48:49 -0700 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2020-05-14 07:25:45 +0000 |
commit | 6b347a406de873a5703b99f46ae490bf2ae2cec6 (patch) | |
tree | 7f6409f8e4139a1cc500161640fdf3c76c1e58da | |
parent | 00e0cf4241be4142316882d70e03a2b20258c224 (diff) | |
download | samba-6b347a406de873a5703b99f46ae490bf2ae2cec6.tar.gz |
s3: VFS: default. Change pwrite() -> sys_pwrite_full() in SMB_VFS_PWRITE_SEND() to protect against short writes.
Note that as sys_pwrite_full() deals with the EINTR case
we can remove the do {} while loop here.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14361
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 801c06f4c9400343b72cad998086288931f7c6b3)
-rw-r--r-- | source3/modules/vfs_default.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 809c9b3d92f..4cf553411cb 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -971,10 +971,10 @@ static void vfs_pwrite_do(void *private_data) PROFILE_TIMESTAMP(&start_time); - do { - state->ret = pwrite(state->fd, state->buf, state->count, - state->offset); - } while ((state->ret == -1) && (errno == EINTR)); + state->ret = sys_pwrite_full(state->fd, + state->buf, + state->count, + state->offset); if (state->ret == -1) { state->vfs_aio_state.error = errno; |