diff options
author | Martin Schwenke <martin@meltin.net> | 2017-07-04 14:02:14 +1000 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2017-09-19 13:30:27 +0200 |
commit | 8fb6c1adb03e33159059cb1343a27c588c4cb6d5 (patch) | |
tree | 177331d12b8971d83e8ce50dcc6832358acc4d6c /ctdb/tools | |
parent | fd54d47875be20477cae45d173ba1eebd748fbbb (diff) | |
download | samba-8fb6c1adb03e33159059cb1343a27c588c4cb6d5.tar.gz |
ctdb-tools: Move special case of 0 connections into computation
This avoids other potential users from unnecessarily setting up file
descriptors and such.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tools')
-rw-r--r-- | ctdb/tools/ctdb_killtcp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ctdb/tools/ctdb_killtcp.c b/ctdb/tools/ctdb_killtcp.c index 1917652ee66..a004f724451 100644 --- a/ctdb/tools/ctdb_killtcp.c +++ b/ctdb/tools/ctdb_killtcp.c @@ -76,6 +76,12 @@ static struct tevent_req *reset_connections_send( state->ev = ev; + if (conn_list->num == 0) { + /* No connections, done! */ + tevent_req_done(req); + return tevent_req_post(req, ev); + } + ret = db_hash_init(state, "connections", 2048, DB_HASH_SIMPLE, &state->connections); if (ret != 0) { @@ -378,12 +384,6 @@ int main(int argc, char **argv) goto fail; } - if (conn_list->num == 0) { - /* No connections, done! */ - talloc_free(mem_ctx); - return 0; - } - req = reset_connections_send(mem_ctx, ev, argv[1], conn_list); if (req == NULL) { goto fail; |