diff options
Diffstat (limited to 'lib/util')
-rw-r--r-- | lib/util/tevent_ntstatus.c | 12 | ||||
-rw-r--r-- | lib/util/tevent_ntstatus.h | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/util/tevent_ntstatus.c b/lib/util/tevent_ntstatus.c index 764d251b59..cbbc698bb1 100644 --- a/lib/util/tevent_ntstatus.c +++ b/lib/util/tevent_ntstatus.c @@ -19,6 +19,7 @@ #include "../replace/replace.h" #include "tevent_ntstatus.h" +#include "libcli/util/error.h" #define TEVENT_NTERROR_MAGIC (0x917b5acd) @@ -97,3 +98,14 @@ void tevent_req_simple_finish_ntstatus(struct tevent_req *subreq, } tevent_req_done(req); } + +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_common(errno); + } + return ret; +} diff --git a/lib/util/tevent_ntstatus.h b/lib/util/tevent_ntstatus.h index 4ac9243320..570b6f951a 100644 --- a/lib/util/tevent_ntstatus.h +++ b/lib/util/tevent_ntstatus.h @@ -40,4 +40,8 @@ NTSTATUS tevent_req_simple_recv_ntstatus(struct tevent_req *req); void tevent_req_simple_finish_ntstatus(struct tevent_req *subreq, NTSTATUS subreq_status); +bool tevent_req_poll_ntstatus(struct tevent_req *req, + struct tevent_context *ev, + NTSTATUS *status); + #endif |