From 0226428eb9d7c6d3a4984d571622f21e9c82e408 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 2 Apr 2011 11:46:30 +0200 Subject: s3: Use cli_writeall instead of cli_write Signed-off-by: Jeremy Allison --- source3/libsmb/libsmb_file.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/libsmb') 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 ... */ } /* -- cgit