summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-02-21 09:53:11 +1100
committerAndrew Bartlett <abartlet@samba.org>2008-02-21 09:53:11 +1100
commit49b3a4829325967df9d1e616ad32e5379ce6cf5d (patch)
tree7c3d8aeb8418fe22236ecd20856d513f239c4d5a
parenta5acc6654ba5a7d2dcf7ae1e4cbb727a29fe5521 (diff)
downloadsamba-49b3a4829325967df9d1e616ad32e5379ce6cf5d.tar.gz
samba-49b3a4829325967df9d1e616ad32e5379ce6cf5d.tar.bz2
samba-49b3a4829325967df9d1e616ad32e5379ce6cf5d.zip
Until the new ldb changes land, make ldb_wait set the error string.
This makes it easier to track down which module only returned and error code, but not the error string. Andrew Bartlett (This used to be commit c4d502f68fbd5d5bc2ac5bb6369950379c9176fc)
-rw-r--r--source4/lib/ldb/common/ldb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index 87f791cb38..5601a33191 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/lib/ldb/common/ldb.c
@@ -463,11 +463,17 @@ static int ldb_autotransaction_request(struct ldb_context *ldb, struct ldb_reque
int ldb_wait(struct ldb_handle *handle, enum ldb_wait_type type)
{
+ int ret;
if (!handle) {
return LDB_SUCCESS;
}
- return handle->module->ops->wait(handle, type);
+ ret = handle->module->ops->wait(handle, type);
+ if (!ldb_errstring(handle->module->ldb)) {
+ /* Set a default error string, to place the blame somewhere */
+ ldb_asprintf_errstring(handle->module->ldb, "error waiting on module %s: %s (%d)", handle->module->ops->name, ldb_strerror(ret), ret);
+ }
+ return ret;
}
/* set the specified timeout or, if timeout is 0 set the default timeout */