1
0
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:
Volker Lendecke 2012-05-24 13:49:26 +02:00 committed by Kai Blin
parent 6cdbce266b
commit 54cde76e37
2 changed files with 16 additions and 0 deletions

View File

@ -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;
}

View File

@ -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