summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2005-01-03 08:52:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:15 -0500
commitab4e92ab21887430774fda380ccbb14a10cab2da (patch)
tree75917be79bcbe061e61dbd44e062dc613a05583f
parent586949362684864a18f9a56b5a96f7c4b8331281 (diff)
downloadsamba-ab4e92ab21887430774fda380ccbb14a10cab2da.tar.gz
samba-ab4e92ab21887430774fda380ccbb14a10cab2da.tar.bz2
samba-ab4e92ab21887430774fda380ccbb14a10cab2da.zip
r4502: add an error reporting function
(This used to be commit 985a58a16d04f3b92b4bbff86f6c466385f01321)
-rw-r--r--source4/lib/ldb/modules/timestamps.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/source4/lib/ldb/modules/timestamps.c b/source4/lib/ldb/modules/timestamps.c
index 53c39e751e..95a2ddc88e 100644
--- a/source4/lib/ldb/modules/timestamps.c
+++ b/source4/lib/ldb/modules/timestamps.c
@@ -230,6 +230,14 @@ static int timestamps_unlock(struct ldb_module *module, const char *lockname)
static const char *timestamps_errstring(struct ldb_module *module)
{
ldb_debug(module->ldb, LDB_DEBUG_TRACE, "timestamps_errstring\n");
+ if (data->error_string) {
+ char *error;
+
+ error = data->error_string;
+ data->error_string = NULL;
+ return error;
+ }
+
return ldb_next_errstring(module);
}
@@ -256,14 +264,22 @@ struct ldb_module *timestamps_module_init(struct ldb_context *ldb, const char *o
#endif
{
struct ldb_module *ctx;
+ struct private_data *data;
ctx = talloc_p(ldb, struct ldb_module);
if (!ctx)
return NULL;
+ data = talloc_p(ctx, struct private_data);
+ if (!data) {
+ talloc_free(ctx);
+ return NULL;
+ }
+
+ data->error_string = NULL;
+ ctx->private_data = data;
ctx->ldb = ldb;
ctx->prev = ctx->next = NULL;
- ctx->private_data = NULL;
ctx->ops = &timestamps_ops;
return ctx;