ctdb-daemon: Simplify code a bit
authorAmitay Isaacs <amitay@gmail.com>
Tue, 24 Jun 2014 02:04:25 +0000 (12:04 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 9 Jul 2014 02:19:12 +0000 (04:19 +0200)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
ctdb/server/ctdb_ltdb_server.c

index 14bfdc32a6f523140e923eab79f4f471770e6258..bec27c8992c8fd117fc69150014cb3db8af63dc0 100644 (file)
@@ -1065,6 +1065,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
        struct ctdb_db_context *db;
        struct ctdb_node *node = ctdb->nodes[ctdb->pnn];
        struct ctdb_client *client = NULL;
+       bool with_jenkinshash;
 
        if (ctdb->tunable.allow_client_db_attach == 0) {
                DEBUG(DEBUG_ERR, ("DB Attach to database %s denied by tunable "
@@ -1134,7 +1135,10 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
                return 0;
        }
 
-       if (ctdb_local_attach(ctdb, db_name, persistent, NULL, (tdb_flags&TDB_INCOMPATIBLE_HASH)?true:false) != 0) {
+       with_jenkinshash = (tdb_flags & TDB_INCOMPATIBLE_HASH) ? true : false;
+
+       if (ctdb_local_attach(ctdb, db_name, persistent, NULL,
+                             with_jenkinshash) != 0) {
                return -1;
        }