Merge branch 'v4-0-test' of git://git.samba.org/samba into 4-0-local
authorAndrew Bartlett <abartlet@samba.org>
Wed, 20 Feb 2008 22:55:13 +0000 (09:55 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 20 Feb 2008 22:55:13 +0000 (09:55 +1100)
(This used to be commit 5cd3310b78a85243eb436d05db3228c3495f9162)

source4/lib/ldb/common/ldb.c

index 5f2e5e3ffc7a0cb9439b995271a4fa35495ba7b4..3c9ef3ff6939f8095952e48766318be9bb52500c 100644 (file)
@@ -508,11 +508,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 */