summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-08-05 11:27:14 +1000
committerStefan Metzmacher <metze@samba.org>2016-08-10 11:24:37 +0200
commitaa3e881e38b7eb6971e2c0c0074ca57227256444 (patch)
tree043a2d9e7850ed5c4c2699f141f62764cd62fc0d
parent08d6c264d257d8d6dd29acfcd8e3b24f24a39ace (diff)
downloadsamba-aa3e881e38b7eb6971e2c0c0074ca57227256444.tar.gz
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 <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 1f6835c73245366111946b92605315c0cac84295)
-rw-r--r--ctdb/tools/ctdb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 8ed77849327..0c19413c67f 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,