summaryrefslogtreecommitdiff
path: root/source3/libsmb/clifile.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/clifile.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/clifile.c')
-rw-r--r--source3/libsmb/clifile.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 63e6c474db..3c13383669 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -1484,13 +1484,19 @@ struct tevent_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
int flags, int share_mode)
{
struct tevent_req *req, *subreq;
+ NTSTATUS status;
req = cli_open_create(mem_ctx, ev, cli, fname, flags, share_mode,
&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;
}
@@ -1612,12 +1618,18 @@ struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
uint16_t fnum)
{
struct tevent_req *req, *subreq;
+ NTSTATUS status;
req = cli_close_create(mem_ctx, ev, cli, fnum, &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;
}