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:
parent
6133ab6055
commit
c254349261
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user