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

Introduce tevent_req_poll_ntstatus

This commit is contained in:
Volker Lendecke 2009-11-14 10:01:44 +01:00
parent c254349261
commit f38edcd61a
2 changed files with 25 additions and 0 deletions

View File

@ -74,3 +74,20 @@ void tevent_req_simple_finish_ntstatus(struct tevent_req *subreq,
}
tevent_req_done(req);
}
/*
* We have to declare map_nt_error_from_unix here, both s3 and s4 have their
* (different) implementations of it.
*/
NTSTATUS map_nt_error_from_unix(int sys_errno);
bool tevent_req_poll_ntstatus(struct tevent_req *req,
struct tevent_context *ev,
NTSTATUS *status)
{
bool ret = tevent_req_poll(req, ev);
if (!ret) {
*status = map_nt_error_from_unix(errno);
}
return ret;
}

View File

@ -36,4 +36,12 @@ NTSTATUS tevent_req_simple_recv_ntstatus(struct tevent_req *req);
void tevent_req_simple_finish_ntstatus(struct tevent_req *subreq,
NTSTATUS subreq_status);
/*
* Wrapper for tevent_req_poll that grabs NTSTATUS directly in case of a
* failure
*/
bool tevent_req_poll_ntstatus(struct tevent_req *req,
struct tevent_context *ev,
NTSTATUS *status);
#endif