[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha2-772-g4e459f1

Kai Blin kai at samba.org
Tue Feb 12 11:50:13 GMT 2008


The branch, v4-0-test has been updated
       via  4e459f1fb3ab60c586df9a08cdc57db424a30b18 (commit)
      from  51769f5cfc0f3a9f85ea533598a1f769e108d075 (commit)

http://gitweb.samba.org/?samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 4e459f1fb3ab60c586df9a08cdc57db424a30b18
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 12 12:16:38 2008 +0100

    [PATCH] composite: make it possible to call composite_is_ok() without callback fn
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source/libcli/composite/composite.c |   31 +++++++++++++------------------
 1 files changed, 13 insertions(+), 18 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/libcli/composite/composite.c b/source/libcli/composite/composite.c
index 67d5885..aab7487 100644
--- a/source/libcli/composite/composite.c
+++ b/source/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) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list