mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
lib: add tevent_req_poll_werror
Signed-off-by: Kai Blin <kai@samba.org>
This commit is contained in:
parent
6cdbce266b
commit
54cde76e37
@ -19,6 +19,7 @@
|
||||
|
||||
#include "../replace/replace.h"
|
||||
#include "tevent_werror.h"
|
||||
#include "libcli/util/error.h"
|
||||
|
||||
bool _tevent_req_werror(struct tevent_req *req,
|
||||
WERROR werror,
|
||||
@ -79,3 +80,15 @@ void tevent_req_simple_finish_werror(struct tevent_req *subreq,
|
||||
}
|
||||
tevent_req_done(req);
|
||||
}
|
||||
|
||||
bool tevent_req_poll_werror(struct tevent_req *req,
|
||||
struct tevent_context *ev,
|
||||
WERROR *err)
|
||||
{
|
||||
bool ret = tevent_req_poll(req, ev);
|
||||
if (!ret) {
|
||||
NTSTATUS status = map_nt_error_from_unix_common(errno);
|
||||
*err = ntstatus_to_werror(status);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -40,4 +40,7 @@ WERROR tevent_req_simple_recv_werror(struct tevent_req *req);
|
||||
void tevent_req_simple_finish_werror(struct tevent_req *subreq,
|
||||
WERROR subreq_error);
|
||||
|
||||
bool tevent_req_poll_werror(struct tevent_req *req,
|
||||
struct tevent_context *ev,
|
||||
WERROR *err);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user