summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-10-22 11:15:18 +1100
committerAndrew Tridgell <tridge@samba.org>2009-10-22 12:47:55 +1100
commitd483c3bb960823cbf9a812872d6040bc390c48ca (patch)
tree9ab98313f76df821e5a89165f6026fa418f3cb84 /source4/lib/ldb
parentfcd16eab6c9cbba05f3e2719527ed217d816d75c (diff)
downloadsamba-d483c3bb960823cbf9a812872d6040bc390c48ca.tar.gz
samba-d483c3bb960823cbf9a812872d6040bc390c48ca.tar.bz2
samba-d483c3bb960823cbf9a812872d6040bc390c48ca.zip
s4-ldb: fixed tdb error handling in ldb_index.c
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 8578e06c0d..501907578d 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -287,8 +287,10 @@ static int ltdb_dn_list_store(struct ldb_module *module, struct ldb_dn *dn,
rec.dsize = sizeof(void *);
ret = tdb_store(ltdb->idxptr->itdb, key, rec, TDB_INSERT);
-
- return ret;
+ if (ret == -1) {
+ return ltdb_err_map(tdb_error(ltdb->idxptr->itdb));
+ }
+ return LDB_SUCCESS;
}
/*
@@ -320,7 +322,10 @@ static int ltdb_index_traverse_store(struct tdb_context *tdb, TDB_DATA key, TDB_
ltdb->idxptr->error = ltdb_dn_list_store_full(module, dn, list);
talloc_free(dn);
- return ltdb->idxptr->error;
+ if (ltdb->idxptr->error != 0) {
+ return -1;
+ }
+ return 0;
}
/* cleanup the idxptr mode when transaction commits */