diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source3/client/smbspool.c | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2 samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source3/client/smbspool.c')
-rw-r--r-- | source3/client/smbspool.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c index 98c350d7dd..e16086dd67 100644 --- a/source3/client/smbspool.c +++ b/source3/client/smbspool.c @@ -25,6 +25,7 @@ #include "includes.h" #include "system/filesys.h" #include "system/passwd.h" +#include "libsmb/libsmb.h" /* * Starting with CUPS 1.3, Kerberos support is provided by cupsd including @@ -595,14 +596,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; } |