From: Martin Schwenke Date: Fri, 5 Aug 2016 01:27:14 +0000 (+1000) Subject: ctdb-tools: Add early return for empty connection list X-Git-Tag: tevent-0.9.30~209 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f6835c73245366111946b92605315c0cac84295;p=thirdparty%2Fsamba.git ctdb-tools: Add early return for empty connection list BUG: https://bugzilla.samba.org/show_bug.cgi?id=12121 If the connection list is empty then process_clist_send() still creates a request. However, since no subrequests are created for controls sent, tevent_req_poll() waits forever for an event. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 075b3547933..b00c3fc0436 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -3230,6 +3230,9 @@ static int control_addtickle(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, if (ret != 0) { return ret; } + if (count == 0) { + return 0; + } req = process_clist_send(mem_ctx, ctdb, clist, count, ctdb_req_control_tcp_add_delayed_update, @@ -3288,6 +3291,9 @@ static int control_deltickle(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, if (ret != 0) { return ret; } + if (count == 0) { + return 0; + } req = process_clist_send(mem_ctx, ctdb, clist, count, ctdb_req_control_tcp_remove,