summaryrefslogtreecommitdiff
path: root/source3/libsmb/clireadwrite.c
diff options
context:
space:
mode:
authorBo Yang <boyang@samba.org>2009-05-14 10:13:12 +0800
committerBo Yang <boyang@samba.org>2009-05-13 18:47:00 +0800
commit05379f01252fc8b449f36130bcf00c321d7a1c37 (patch)
treeb13cff0de029da42f251e6ecec4e31763b0e3fbc /source3/libsmb/clireadwrite.c
parent42e0cb8c0a1b8470ac8e9ad1c5a741e299debb8f (diff)
downloadsamba-05379f01252fc8b449f36130bcf00c321d7a1c37.tar.gz
samba-05379f01252fc8b449f36130bcf00c321d7a1c37.tar.bz2
samba-05379f01252fc8b449f36130bcf00c321d7a1c37.zip
s3: return proper error code in cli_smb_req_send
Signed-off-by: Bo Yang <boyang@samba.org>
Diffstat (limited to 'source3/libsmb/clireadwrite.c')
-rw-r--r--source3/libsmb/clireadwrite.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index 4e256ede57..d38de19508 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -139,13 +139,19 @@ struct tevent_req *cli_read_andx_send(TALLOC_CTX *mem_ctx,
off_t offset, size_t size)
{
struct tevent_req *req, *subreq;
+ NTSTATUS status;
req = cli_read_andx_create(mem_ctx, ev, cli, fnum, offset, size,
&subreq);
- if ((req == NULL) || !cli_smb_req_send(subreq)) {
- TALLOC_FREE(req);
+ if (req == NULL) {
return NULL;
}
+
+ status = cli_smb_req_send(subreq);
+ if (!NT_STATUS_IS_OK(status)) {
+ tevent_req_nterror(req, status);
+ return tevent_req_post(req, ev);
+ }
return req;
}
@@ -870,13 +876,19 @@ struct tevent_req *cli_write_andx_send(TALLOC_CTX *mem_ctx,
off_t offset, size_t size)
{
struct tevent_req *req, *subreq;
+ NTSTATUS status;
req = cli_write_andx_create(mem_ctx, ev, cli, fnum, mode, buf, offset,
size, NULL, 0, &subreq);
- if ((req == NULL) || !cli_smb_req_send(subreq)) {
- TALLOC_FREE(req);
+ if (req == NULL) {
return NULL;
}
+
+ status = cli_smb_req_send(subreq);
+ if (!NT_STATUS_IS_OK(status)) {
+ tevent_req_nterror(req, status);
+ return tevent_req_post(req, ev);
+ }
return req;
}