summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-04-02 11:46:30 +0200
committerJeremy Allison <jra@samba.org>2011-04-26 12:22:55 -0700
commit0226428eb9d7c6d3a4984d571622f21e9c82e408 (patch)
treef45e1a38b93b580d554ef8b7ad1f47c1cdb48e44 /source3/libsmb
parentd018fccb705e91f33f3211cdc5b8a4006d032f65 (diff)
downloadsamba-0226428eb9d7c6d3a4984d571622f21e9c82e408.tar.gz
samba-0226428eb9d7c6d3a4984d571622f21e9c82e408.tar.bz2
samba-0226428eb9d7c6d3a4984d571622f21e9c82e408.zip
s3: Use cli_writeall instead of cli_write
Signed-off-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/libsmb_file.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c
index 58403dfbb3..4ab6cd22e5 100644
--- a/source3/libsmb/libsmb_file.c
+++ b/source3/libsmb/libsmb_file.c
@@ -318,13 +318,13 @@ SMBC_write_ctx(SMBCCTX *context,
const void *buf,
size_t count)
{
- int ret;
off_t offset;
char *server = NULL, *share = NULL, *user = NULL, *password = NULL;
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
+ NTSTATUS status;
/* First check all pointers before dereferencing them */
@@ -377,18 +377,18 @@ SMBC_write_ctx(SMBCCTX *context,
}
/*d_printf(">>>write: resolved path as %s\n", targetpath);*/
- ret = cli_write(targetcli, file->cli_fd,
- 0, (char *)buf, offset, count);
- if (ret <= 0) {
- errno = SMBC_errno(context, targetcli);
+ status = cli_writeall(targetcli, file->cli_fd,
+ 0, (uint8_t *)buf, offset, count, NULL);
+ if (!NT_STATUS_IS_OK(status)) {
+ errno = map_errno_from_nt_status(status);
TALLOC_FREE(frame);
return -1;
}
- file->offset += ret;
+ file->offset += count;
TALLOC_FREE(frame);
- return ret; /* Success, 0 bytes of data ... */
+ return count; /* Success, 0 bytes of data ... */
}
/*