summaryrefslogtreecommitdiffstats
path: root/source3/client/smbspool.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-01-16 21:13:29 +0100
committerVolker Lendecke <vlendec@samba.org>2011-01-17 08:47:25 +0100
commitd3abc90401c65e66de26cdfb2432ef023732dce7 (patch)
treef0b1b91e399b67baa210f90a84e789276fd8158a /source3/client/smbspool.c
parentc7a5933e4b907d0dc50c01b299a5822392c86049 (diff)
downloadsamba-d3abc90401c65e66de26cdfb2432ef023732dce7.tar.gz
samba-d3abc90401c65e66de26cdfb2432ef023732dce7.tar.xz
samba-d3abc90401c65e66de26cdfb2432ef023732dce7.zip
s3: Avoid a few calls to cli_errstr
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Mon Jan 17 08:47:25 CET 2011 on sn-devel-104
Diffstat (limited to 'source3/client/smbspool.c')
-rw-r--r--source3/client/smbspool.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c
index 0804eb56ec8..c80ad42dd91 100644
--- a/source3/client/smbspool.c
+++ b/source3/client/smbspool.c
@@ -558,6 +558,7 @@ smb_print(struct cli_state * cli, /* I - SMB connection */
tbytes; /* Total bytes read */
char buffer[8192], /* Buffer for copy */
*ptr; /* Pointer into title */
+ NTSTATUS nt_status;
/*
@@ -574,10 +575,12 @@ smb_print(struct cli_state * cli, /* I - SMB connection */
* Open the printer device...
*/
- if (!NT_STATUS_IS_OK(cli_open(cli, title, O_RDWR | O_CREAT | O_TRUNC, DENY_NONE, &fnum))) {
+ nt_status = cli_open(cli, title, O_RDWR | O_CREAT | O_TRUNC, DENY_NONE,
+ &fnum);
+ if (!NT_STATUS_IS_OK(nt_status)) {
fprintf(stderr, "ERROR: %s opening remote spool %s\n",
- cli_errstr(cli), title);
- return (get_exit_code(cli, cli_nt_error(cli)));
+ nt_errstr(nt_status), title);
+ return get_exit_code(cli, nt_status);
}
/*
@@ -602,10 +605,11 @@ smb_print(struct cli_state * cli, /* I - SMB connection */
tbytes += nbytes;
}
- if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) {
+ nt_status = cli_close(cli, fnum);
+ if (!NT_STATUS_IS_OK(nt_status)) {
fprintf(stderr, "ERROR: %s closing remote spool %s\n",
- cli_errstr(cli), title);
- return (get_exit_code(cli, cli_nt_error(cli)));
+ nt_errstr(nt_status), title);
+ return get_exit_code(cli, nt_status);
} else {
return (0);
}