1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

Introduce tevent_req_simple_finish_ntstatus

This commit is contained in:
Volker Lendecke 2009-11-14 09:38:20 +01:00
parent 6133ab6055
commit c254349261
2 changed files with 22 additions and 0 deletions

View File

@ -59,3 +59,18 @@ NTSTATUS tevent_req_simple_recv_ntstatus(struct tevent_req *req)
}
return NT_STATUS_OK;
}
void tevent_req_simple_finish_ntstatus(struct tevent_req *subreq,
NTSTATUS subreq_status)
{
struct tevent_req *req = tevent_req_callback_data(
subreq, struct tevent_req);
TALLOC_FREE(subreq);
if (!NT_STATUS_IS_OK(subreq_status)) {
tevent_req_nterror(req, subreq_status);
return;
}
tevent_req_done(req);
}

View File

@ -29,4 +29,11 @@ bool tevent_req_nterror(struct tevent_req *req, NTSTATUS status);
bool tevent_req_is_nterror(struct tevent_req *req, NTSTATUS *pstatus);
NTSTATUS tevent_req_simple_recv_ntstatus(struct tevent_req *req);
/*
* Helper routine to pass the subreq_ntstatus to the req embedded in
* tevent_req_callback_data(subreq), which will be freed.
*/
void tevent_req_simple_finish_ntstatus(struct tevent_req *subreq,
NTSTATUS subreq_status);
#endif