diff options
author | Volker Lendecke <vl@samba.org> | 2010-10-18 10:09:57 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-10-20 18:09:20 +0200 |
commit | 347ca8f757d6a0b61bb22be21ffffec95986ad94 (patch) | |
tree | d9aa28856431d5b93837de439aed7ad90b9be720 | |
parent | 62bea12c5dbb0e6ec6d74a3d2f8988f183572782 (diff) | |
download | samba-347ca8f757d6a0b61bb22be21ffffec95986ad94.tar.gz samba-347ca8f757d6a0b61bb22be21ffffec95986ad94.tar.bz2 samba-347ca8f757d6a0b61bb22be21ffffec95986ad94.zip |
s3: Add any_nt_status_not_ok
This helps avoid quite a bit of repetitive code when looking at dcerpc_xx_recv
results.
-rw-r--r-- | source3/include/proto.h | 1 | ||||
-rw-r--r-- | source3/lib/util.c | 13 |
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; +} |