s4:lib/messaging: use a helper variable for tdb flags
authorRalph Boehme <slow@samba.org>
Tue, 20 Oct 2015 09:35:23 +0000 (11:35 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 20 Oct 2015 12:54:56 +0000 (14:54 +0200)
Small refactoring that eliminates a nested function call. These are a
pita when stepping with gdb.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11562

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Oct 20 14:54:57 CEST 2015 on sn-devel-104

source4/lib/messaging/messaging.c

index 6d891e56e672299515a2dd26981925d3d019578b..0fc180be2a454257a990d8024d2d7667f74a9cea 100644 (file)
@@ -312,6 +312,7 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
        bool ok;
        int ret;
        const char *lock_dir = NULL;
+       int tdb_flags = TDB_INCOMPATIBLE_HASH | TDB_CLEAR_IF_FIRST;
 
        if (ev == NULL) {
                return NULL;
@@ -368,10 +369,9 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
 
        msg->start_time    = timeval_current();
 
-       msg->names = server_id_db_init(
-               msg, server_id, lock_dir, 0,
-               TDB_INCOMPATIBLE_HASH|TDB_CLEAR_IF_FIRST|
-               lpcfg_tdb_flags(lp_ctx, 0));
+       tdb_flags |= lpcfg_tdb_flags(lp_ctx, 0);
+
+       msg->names = server_id_db_init(msg, server_id, lock_dir, 0, tdb_flags);
        if (msg->names == NULL) {
                goto fail;
        }