ctdb-daemon: Drop duplicate initialisation of request ID context
authorMartin Schwenke <martin@meltin.net>
Wed, 18 Apr 2018 00:51:26 +0000 (10:51 +1000)
committerMartin Schwenke <martins@samba.org>
Tue, 1 May 2018 11:31:19 +0000 (13:31 +0200)
This doesn't require configuration options so keep the instance in
ctdb_init().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdbd.c

index 2046f7a..20f82d7 100644 (file)
@@ -106,6 +106,7 @@ static struct ctdb_context *ctdb_init(struct tevent_context *ev)
                return NULL;
        }
        ctdb->ev  = ev;
+
        /* Wrap early to exercise code. */
        ret = reqid_init(ctdb, INT_MAX-200, &ctdb->idr);
        if (ret != 0) {
@@ -259,13 +260,6 @@ int main(int argc, const char *argv[])
        }
        ctdb->recovery_lock = options.recovery_lock;
 
-       TALLOC_FREE(ctdb->idr);
-       ret = reqid_init(ctdb, 0, &ctdb->idr);;
-       if (ret != 0) {
-               DEBUG(DEBUG_ERR, ("reqid_init failed (%s)\n", strerror(ret)));
-               exit(1);
-       }
-
        ctdb_tunables_set_defaults(ctdb);
 
        ret = ctdb_set_transport(ctdb, options.transport);