summaryrefslogtreecommitdiff
path: root/source3/lib/async_req.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/async_req.c')
-rw-r--r--source3/lib/async_req.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/source3/lib/async_req.c b/source3/lib/async_req.c
index 501a6b5524..159666f15c 100644
--- a/source3/lib/async_req.c
+++ b/source3/lib/async_req.c
@@ -172,3 +172,26 @@ bool async_req_nomem(const void *p, struct async_req *req)
async_req_error(req, NT_STATUS_NO_MEMORY);
return true;
}
+
+bool async_req_is_error(struct async_req *req, NTSTATUS *status)
+{
+ if (req->state < ASYNC_REQ_DONE) {
+ *status = NT_STATUS_INTERNAL_ERROR;
+ return true;
+ }
+ if (req->state == ASYNC_REQ_ERROR) {
+ *status = req->status;
+ return true;
+ }
+ return false;
+}
+
+NTSTATUS async_req_simple_recv(struct async_req *req)
+{
+ NTSTATUS status;
+
+ if (async_req_is_error(req, &status)) {
+ return status;
+ }
+ return NT_STATUS_OK;
+}