summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-10-23 17:23:44 +0200
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-10-25 11:24:54 +0100
commit1ea460b0b0dc4ee8a14c764e81f368d4f7e9ff45 (patch)
tree28ac468ec40edf0a8b9d5fc3981ac380915b066b /source4/lib/ldb/ldb_tdb
parent54bd30f70632b8fcbe164133d2479092b7262a29 (diff)
downloadsamba-1ea460b0b0dc4ee8a14c764e81f368d4f7e9ff45.tar.gz
samba-1ea460b0b0dc4ee8a14c764e81f368d4f7e9ff45.tar.bz2
samba-1ea460b0b0dc4ee8a14c764e81f368d4f7e9ff45.zip
ldb:backend "connect" functions - convert result values to LDB constants
I think this is better since "ldb_backend_connect" and "ldb_connect" which propagate those values should return only LDB constants. Therefore a conversion (especially for "-1") would be needed.
Diffstat (limited to 'source4/lib/ldb/ldb_tdb')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index d6175863da..f1364d5875 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -1319,7 +1319,7 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url,
if (strncmp(url, "tdb://", 6) != 0) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
"Invalid tdb URL '%s'", url);
- return -1;
+ return LDB_ERR_OPERATIONS_ERROR;
}
path = url+6;
} else {
@@ -1347,7 +1347,7 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url,
ltdb = talloc_zero(ldb, struct ltdb_private);
if (!ltdb) {
ldb_oom(ldb);
- return -1;
+ return LDB_ERR_OPERATIONS_ERROR;
}
/* note that we use quite a large default hash size */
@@ -1358,7 +1358,7 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url,
ldb_debug(ldb, LDB_DEBUG_ERROR,
"Unable to open tdb '%s'", path);
talloc_free(ltdb);
- return -1;
+ return LDB_ERR_OPERATIONS_ERROR;
}
ltdb->sequence_number = 0;
@@ -1366,7 +1366,7 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url,
module = ldb_module_new(ldb, ldb, "ldb_tdb backend", &ltdb_ops);
if (!module) {
talloc_free(ltdb);
- return -1;
+ return LDB_ERR_OPERATIONS_ERROR;
}
ldb_module_set_private(module, ltdb);
talloc_steal(module, ltdb);
@@ -1374,11 +1374,11 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url,
if (ltdb_cache_load(module) != 0) {
talloc_free(module);
talloc_free(ltdb);
- return -1;
+ return LDB_ERR_OPERATIONS_ERROR;
}
*_module = module;
- return 0;
+ return LDB_SUCCESS;
}
const struct ldb_backend_ops ldb_tdb_backend_ops = {