diff options
author | Volker Lendecke <vl@samba.org> | 2011-04-02 11:46:30 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-04-26 12:22:55 -0700 |
commit | 0226428eb9d7c6d3a4984d571622f21e9c82e408 (patch) | |
tree | f45e1a38b93b580d554ef8b7ad1f47c1cdb48e44 /source3/client | |
parent | d018fccb705e91f33f3211cdc5b8a4006d032f65 (diff) | |
download | samba-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/client')
-rw-r--r-- | source3/client/clitar.c | 8 | ||||
-rw-r--r-- | source3/client/smbspool.c | 17 |
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; } |