summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-02-22 05:21:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:59 -0500
commitd590dea10b3abf93fcc8138189291e8b66bae7d7 (patch)
treed859a38ca49d480c36e3a8a3ef2ac28e2b964066 /source4/lib/ldb/common/ldb.c
parent00fe70e5b917769418f68eaa255d3a06a9a08ce7 (diff)
downloadsamba-d590dea10b3abf93fcc8138189291e8b66bae7d7.tar.gz
samba-d590dea10b3abf93fcc8138189291e8b66bae7d7.tar.bz2
samba-d590dea10b3abf93fcc8138189291e8b66bae7d7.zip
r13615: Make ldb_set_errstring get ldb instead of module as parameter.
The module was just used to get to the ldb so it was meningless. Also add LDB_WAIT_ONCE e relative code in ldb_ildap.c (This used to be commit d5b467b7c132b0bd4d23918ba7bf3370b1afcce8)
Diffstat (limited to 'source4/lib/ldb/common/ldb.c')
-rw-r--r--source4/lib/ldb/common/ldb.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index 68722cde96..87705a855a 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/lib/ldb/common/ldb.c
@@ -106,12 +106,12 @@ int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, co
return LDB_SUCCESS;
}
-void ldb_set_errstring(struct ldb_module *module, char *err_string)
+void ldb_set_errstring(struct ldb_context *ldb, char *err_string)
{
- if (module->ldb->err_string) {
- talloc_free(module->ldb->err_string);
+ if (ldb->err_string) {
+ talloc_free(ldb->err_string);
}
- module->ldb->err_string = talloc_steal(module->ldb, err_string);
+ ldb->err_string = talloc_steal(ldb, err_string);
}
void ldb_reset_err_string(struct ldb_context *ldb)
@@ -158,7 +158,7 @@ int ldb_transaction_start(struct ldb_context *ldb)
if (status != LDB_SUCCESS) {
if (ldb->err_string == NULL) {
/* no error string was setup by the backend */
- ldb_set_errstring(ldb->modules,
+ ldb_set_errstring(ldb,
talloc_asprintf(ldb, "ldb transaction start error %d", status));
}
}
@@ -186,7 +186,7 @@ int ldb_transaction_commit(struct ldb_context *ldb)
if (status != LDB_SUCCESS) {
if (ldb->err_string == NULL) {
/* no error string was setup by the backend */
- ldb_set_errstring(ldb->modules,
+ ldb_set_errstring(ldb,
talloc_asprintf(ldb, "ldb transaction commit error %d", status));
}
}
@@ -212,7 +212,7 @@ int ldb_transaction_cancel(struct ldb_context *ldb)
if (status != LDB_SUCCESS) {
if (ldb->err_string == NULL) {
/* no error string was setup by the backend */
- ldb_set_errstring(ldb->modules,
+ ldb_set_errstring(ldb,
talloc_asprintf(ldb, "ldb transaction cancel error %d", status));
}
}
@@ -238,7 +238,7 @@ static int ldb_op_finish(struct ldb_context *ldb, int status)
}
if (ldb->err_string == NULL) {
/* no error string was setup by the backend */
- ldb_set_errstring(ldb->modules,
+ ldb_set_errstring(ldb,
talloc_asprintf(ldb, "ldb error %d", status));
}
ldb_transaction_cancel(ldb);
@@ -330,7 +330,7 @@ int ldb_search(struct ldb_context *ldb,
tree = ldb_parse_tree(ldb, expression);
if (tree == NULL) {
- ldb_set_errstring(ldb->modules, talloc_strdup(ldb, "Unable to parse search expression"));
+ ldb_set_errstring(ldb, talloc_strdup(ldb, "Unable to parse search expression"));
return -1;
}