From f3af298e5b1457ba8661fd0e3f5304ad3175f3ba Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 30 Apr 2009 16:57:42 -0700 Subject: Cause cli_close to return an NTSTATUS. Jeremy. --- source3/client/client.c | 6 +++--- source3/client/clitar.c | 5 +++-- source3/client/smbspool.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/client') diff --git a/source3/client/client.c b/source3/client/client.c index becb0661534..d3cf08cce81 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -1078,7 +1078,7 @@ static int do_get(const char *rname, const char *lname_in, bool reget) return 1; } - if (!cli_close(targetcli, fnum)) { + if (!NT_STATUS_IS_OK(cli_close(targetcli, fnum))) { d_printf("Error %s closing remote file\n",cli_errstr(cli)); rc = 1; } @@ -1690,7 +1690,7 @@ static int do_put(const char *rname, const char *lname, bool reput) d_fprintf(stderr, "cli_push returned %s\n", nt_errstr(status)); } - if (!cli_close(targetcli, fnum)) { + if (!NT_STATUS_IS_OK(cli_close(targetcli, fnum))) { d_printf("%s closing remote file %s\n",cli_errstr(cli),rname); x_fclose(f); return 1; @@ -2459,7 +2459,7 @@ static int cmd_close(void) fnum = atoi(buf); /* We really should use the targetcli here.... */ - if (!cli_close(cli, fnum)) { + if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) { d_printf("close %d: %s\n", fnum, cli_errstr(cli)); return 1; } diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 3cc1a25dbbc..c7f2819c88a 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -1067,8 +1067,9 @@ static int get_file(file_info2 finfo) /* Now close the file ... */ - if (!cli_close(cli, fnum)) { - DEBUG(0, ("Error closing remote file\n")); + if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) { + DEBUG(0, ("Error %s closing remote file\n", + cli_errstr(cli))); return(False); } diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c index 6b099dbc0bc..07de579e017 100644 --- a/source3/client/smbspool.c +++ b/source3/client/smbspool.c @@ -602,7 +602,7 @@ smb_print(struct cli_state * cli, /* I - SMB connection */ tbytes += nbytes; } - if (!cli_close(cli, fnum)) { + if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) { fprintf(stderr, "ERROR: %s closing remote spool %s\n", cli_errstr(cli), title); return (get_exit_code(cli, cli_nt_error(cli))); -- cgit