summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/clitar.c8
-rw-r--r--source3/client/smbspool.c17
2 files changed, 17 insertions, 8 deletions
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index b46115becf..645899a9ff 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -1045,8 +1045,12 @@ static int get_file(file_info2 finfo)
dsize = MIN(dsize, rsize); /* Should be only what is left */
DEBUG(5, ("writing %i bytes, bpos = %i ...\n", dsize, bpos));
- if (cli_write(cli, fnum, 0, buffer_p + bpos, pos, dsize) != dsize) {
- DEBUG(0, ("Error writing remote file\n"));
+ status = cli_writeall(cli, fnum, 0,
+ (uint8_t *)(buffer_p + bpos), pos,
+ dsize, NULL);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("Error writing remote file: %s\n",
+ nt_errstr(status)));
return 0;
}
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c
index 98c350d7dd..5a736c4930 100644
--- a/source3/client/smbspool.c
+++ b/source3/client/smbspool.c
@@ -595,14 +595,19 @@ smb_print(struct cli_state * cli, /* I - SMB connection */
tbytes = 0;
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0) {
- if (cli_write(cli, fnum, 0, buffer, tbytes, nbytes) != nbytes) {
- int status = get_exit_code(cli, cli_nt_error(cli));
-
- fprintf(stderr, "ERROR: Error writing spool: %s\n", cli_errstr(cli));
- fprintf(stderr, "DEBUG: Returning status %d...\n", status);
+ NTSTATUS status;
+
+ status = cli_writeall(cli, fnum, 0, (uint8_t *)buffer,
+ tbytes, nbytes, NULL);
+ if (!NT_STATUS_IS_OK(status)) {
+ int ret = get_exit_code(cli, status);
+ fprintf(stderr, "ERROR: Error writing spool: %s\n",
+ nt_errstr(status));
+ fprintf(stderr, "DEBUG: Returning status %d...\n",
+ ret);
cli_close(cli, fnum);
- return (status);
+ return (ret);
}
tbytes += nbytes;
}