summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2021-01-17 11:04:47 +0100
committerJeremy Allison <jra@samba.org>2021-01-22 19:54:38 +0000
commite593f969607791571248dd3341089001f49362fa (patch)
tree5218d79bd5442254218744569a3638ee9329ca41 /ctdb
parentf055d3f7db1c6eb47a5773f3cbe5bf8a047f3830 (diff)
downloadsamba-e593f969607791571248dd3341089001f49362fa.tar.gz
lib: Make accept_recv() return the listening socket
This is helpful if you are in a listening loop with the same receiver for many sockets doing the same thing. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/common/sock_daemon.c2
-rw-r--r--ctdb/tests/src/comm_server_test.c2
-rw-r--r--ctdb/tests/src/fake_ctdbd.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/ctdb/common/sock_daemon.c b/ctdb/common/sock_daemon.c
index 7d026515d68..6298653f4ec 100644
--- a/ctdb/common/sock_daemon.c
+++ b/ctdb/common/sock_daemon.c
@@ -371,7 +371,7 @@ static void sock_socket_start_new_client(struct tevent_req *subreq)
struct sock_client *client;
int client_fd, ret;
- client_fd = accept_recv(subreq, NULL, &ret);
+ client_fd = accept_recv(subreq, NULL, NULL, &ret);
TALLOC_FREE(subreq);
if (client_fd == -1) {
D_ERR("failed to accept new connection\n");
diff --git a/ctdb/tests/src/comm_server_test.c b/ctdb/tests/src/comm_server_test.c
index 721aa679b63..86b5658b949 100644
--- a/ctdb/tests/src/comm_server_test.c
+++ b/ctdb/tests/src/comm_server_test.c
@@ -175,7 +175,7 @@ static void socket_process_client(struct tevent_req *subreq)
int client_fd;
int err = 0;
- client_fd = accept_recv(subreq, NULL, &err);
+ client_fd = accept_recv(subreq, NULL, NULL, &err);
TALLOC_FREE(subreq);
state->num_clients++;
diff --git a/ctdb/tests/src/fake_ctdbd.c b/ctdb/tests/src/fake_ctdbd.c
index 2b2ed066f75..146b7da344c 100644
--- a/ctdb/tests/src/fake_ctdbd.c
+++ b/ctdb/tests/src/fake_ctdbd.c
@@ -4284,7 +4284,7 @@ static void server_new_client(struct tevent_req *subreq)
int client_fd;
int ret = 0;
- client_fd = accept_recv(subreq, NULL, &ret);
+ client_fd = accept_recv(subreq, NULL, NULL, &ret);
TALLOC_FREE(subreq);
if (client_fd == -1) {
tevent_req_error(req, ret);