diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-02-13 10:14:04 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-02-13 10:14:04 +1100 |
commit | 7714a91f6762bb8d6578d89a49bfd5672aca054c (patch) | |
tree | 60b4d72b94ecb96f95e4d8e7041bf8abe58e8fa8 /source4/libcli | |
parent | e94d710b0b959d8e69eb02ef0704ebcff56485fb (diff) | |
parent | 3cfac63d165f072464e93a12f7ad48450c66477b (diff) | |
download | samba-7714a91f6762bb8d6578d89a49bfd5672aca054c.tar.gz samba-7714a91f6762bb8d6578d89a49bfd5672aca054c.tar.bz2 samba-7714a91f6762bb8d6578d89a49bfd5672aca054c.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit 11102681bcd70b0abb2df38bcdc7fdec51e71600)
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/composite/composite.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/source4/libcli/composite/composite.c b/source4/libcli/composite/composite.c index 67d5885497..aab7487a42 100644 --- a/source4/libcli/composite/composite.c +++ b/source4/libcli/composite/composite.c @@ -64,23 +64,6 @@ _PUBLIC_ NTSTATUS composite_wait(struct composite_context *c) return c->status; } - -/* - * Some composite helpers that are handy if you write larger composite - * functions. - */ -_PUBLIC_ bool composite_is_ok(struct composite_context *ctx) -{ - if (NT_STATUS_IS_OK(ctx->status)) { - return true; - } - ctx->state = COMPOSITE_STATE_ERROR; - if (ctx->async.fn != NULL) { - ctx->async.fn(ctx); - } - return false; -} - /* callback from composite_done() and composite_error() @@ -110,7 +93,10 @@ _PUBLIC_ void composite_error(struct composite_context *ctx, NTSTATUS status) event_add_timed(ctx->event_ctx, ctx, timeval_zero(), composite_trigger, ctx); } ctx->status = status; - SMB_ASSERT(!composite_is_ok(ctx)); + ctx->state = COMPOSITE_STATE_ERROR; + if (ctx->async.fn != NULL) { + ctx->async.fn(ctx); + } } _PUBLIC_ bool composite_nomem(const void *p, struct composite_context *ctx) @@ -122,6 +108,15 @@ _PUBLIC_ bool composite_nomem(const void *p, struct composite_context *ctx) return true; } +_PUBLIC_ bool composite_is_ok(struct composite_context *ctx) +{ + if (NT_STATUS_IS_OK(ctx->status)) { + return true; + } + composite_error(ctx, ctx->status); + return false; +} + _PUBLIC_ void composite_done(struct composite_context *ctx) { if (!ctx->used_wait && !ctx->async.fn) { |