summaryrefslogtreecommitdiff
path: root/lib/dbwrap
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2018-08-18 09:12:21 +0200
committerJeremy Allison <jra@samba.org>2018-09-12 22:25:19 +0200
commit9a9620bb4252a76385284092a1497920e86b34eb (patch)
treeca1e1090f5f3ac55a5dfac5d3a8f336ed1f1eeef /lib/dbwrap
parent6617b2db35ec6f5f5acb979bf672414a1f9e5657 (diff)
downloadsamba-9a9620bb4252a76385284092a1497920e86b34eb.tar.gz
dbwrap_tdb: move a function call out of an if condition
At least for me this improves readability somewhat. No change in behaviour. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/dbwrap')
-rw-r--r--lib/dbwrap/dbwrap_tdb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/dbwrap/dbwrap_tdb.c b/lib/dbwrap/dbwrap_tdb.c
index f59764535a2..19f2f009c0c 100644
--- a/lib/dbwrap/dbwrap_tdb.c
+++ b/lib/dbwrap/dbwrap_tdb.c
@@ -116,13 +116,16 @@ static struct db_record *db_tdb_fetch_locked_internal(
struct db_tdb_ctx *ctx = talloc_get_type_abort(db->private_data,
struct db_tdb_ctx);
struct tdb_fetch_locked_state state;
+ int ret;
state.mem_ctx = mem_ctx;
state.result = NULL;
- if ((tdb_parse_record(ctx->wtdb->tdb, key, db_tdb_fetchlock_parse,
- &state) < 0) &&
- (tdb_error(ctx->wtdb->tdb) != TDB_ERR_NOEXIST)) {
+ ret = tdb_parse_record(ctx->wtdb->tdb,
+ key,
+ db_tdb_fetchlock_parse,
+ &state);
+ if ((ret < 0) && (tdb_error(ctx->wtdb->tdb) != TDB_ERR_NOEXIST)) {
tdb_chainunlock(ctx->wtdb->tdb, key);
return NULL;
}