summaryrefslogtreecommitdiff
path: root/ctdb/protocol
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2018-07-18 19:00:42 +1000
committerMartin Schwenke <martins@samba.org>2018-07-28 03:50:11 +0200
commit3bf753e830c20183ef4f3278880d3be362e53bef (patch)
treeecc4d85d0ebe07d42fabb1ffb891d217986ef8c6 /ctdb/protocol
parentc9b42d27e6cf9e6ae36f44970f0a388edc737a7a (diff)
downloadsamba-3bf753e830c20183ef4f3278880d3be362e53bef.tar.gz
ctdb-common: Add fd argument to ctdb_connection_list_read()
This makes testing easier. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/protocol')
-rw-r--r--ctdb/protocol/protocol_util.c6
-rw-r--r--ctdb/protocol/protocol_util.h4
2 files changed, 7 insertions, 3 deletions
diff --git a/ctdb/protocol/protocol_util.c b/ctdb/protocol/protocol_util.c
index 7ce19c1f79c..75427e44f50 100644
--- a/ctdb/protocol/protocol_util.c
+++ b/ctdb/protocol/protocol_util.c
@@ -679,7 +679,9 @@ static int ctdb_connection_list_read_line(char *line, void *private_data)
return 0;
}
-int ctdb_connection_list_read(TALLOC_CTX *mem_ctx, bool client_first,
+int ctdb_connection_list_read(TALLOC_CTX *mem_ctx,
+ int fd,
+ bool client_first,
struct ctdb_connection_list **conn_list)
{
struct ctdb_connection_list_read_state state;
@@ -696,7 +698,7 @@ int ctdb_connection_list_read(TALLOC_CTX *mem_ctx, bool client_first,
state.client_first = client_first;
- ret = line_read(0,
+ ret = line_read(fd,
128,
mem_ctx,
ctdb_connection_list_read_line,
diff --git a/ctdb/protocol/protocol_util.h b/ctdb/protocol/protocol_util.h
index fa7189c22a4..a51cbcdda98 100644
--- a/ctdb/protocol/protocol_util.h
+++ b/ctdb/protocol/protocol_util.h
@@ -69,7 +69,9 @@ int ctdb_connection_list_sort(struct ctdb_connection_list *conn_list);
const char *ctdb_connection_list_to_string(
TALLOC_CTX *mem_ctx,
struct ctdb_connection_list *conn_list, bool client_first);
-int ctdb_connection_list_read(TALLOC_CTX *mem_ctx, bool client_first,
+int ctdb_connection_list_read(TALLOC_CTX *mem_ctx,
+ int fd,
+ bool client_first,
struct ctdb_connection_list **conn_list);
#endif /* __CTDB_PROTOCOL_UTIL_H__ */