summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/lib/util.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 3e4655eeb5..6ce27b8200 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1204,6 +1204,7 @@ const char *strip_hostname(const char *s);
bool tevent_req_poll_ntstatus(struct tevent_req *req,
struct tevent_context *ev,
NTSTATUS *status);
+bool any_nt_status_not_ok(NTSTATUS err1, NTSTATUS err2, NTSTATUS *result);
/* The following definitions come from lib/util_file.c */
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 36b2e422e2..4baeda4d0a 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -2965,3 +2965,16 @@ bool tevent_req_poll_ntstatus(struct tevent_req *req,
}
return ret;
}
+
+bool any_nt_status_not_ok(NTSTATUS err1, NTSTATUS err2, NTSTATUS *result)
+{
+ if (!NT_STATUS_IS_OK(err1)) {
+ *result = err1;
+ return true;
+ }
+ if (!NT_STATUS_IS_OK(err2)) {
+ *result = err2;
+ return true;
+ }
+ return false;
+}