diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-06-20 18:40:31 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-06-20 11:18:35 +0200 |
commit | 6bc59d77b64d1ecbe5c906ed2fa80a7b8ca5d420 (patch) | |
tree | 616215df22728c5e4e95cf20f80ff62051274531 /source4/lib/ldb | |
parent | 1078eb21c49d707ddeef2257353f35c10d131b9f (diff) | |
download | samba-6bc59d77b64d1ecbe5c906ed2fa80a7b8ca5d420.tar.gz samba-6bc59d77b64d1ecbe5c906ed2fa80a7b8ca5d420.tar.bz2 samba-6bc59d77b64d1ecbe5c906ed2fa80a7b8ca5d420.zip |
tdb_store: check returns for 0, not -1.
TDB2 returns a negative error number on failure. This is compatible
if we always check for != 0 instead of == -1.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_index.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_tdb.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index 45e747379f..0e9f1e75dd 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -294,7 +294,7 @@ 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); - if (ret == -1) { + if (ret != 0) { return ltdb_err_map(tdb_error(ltdb->idxptr->itdb)); } return LDB_SUCCESS; diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c index 77a75a4504..436ef46b33 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c @@ -264,7 +264,7 @@ int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flg } ret = tdb_store(ltdb->tdb, tdb_key, tdb_data, flgs); - if (ret == -1) { + if (ret != 0) { ret = ltdb_err_map(tdb_error(ltdb->tdb)); goto done; } |