From 7e8c38c672e816ea3b0d9a7accdcae4d6e01c668 Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Tue, 24 May 2011 10:20:43 -0400 Subject: [PATCH] Move accept sequence We only accept one connection, so move it outside the main loop. Signed-off-by: Julien Desfossez --- kconsumerd/kconsumerd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kconsumerd/kconsumerd.c b/kconsumerd/kconsumerd.c index 315095ee3..96051caaf 100644 --- a/kconsumerd/kconsumerd.c +++ b/kconsumerd/kconsumerd.c @@ -511,13 +511,13 @@ static void *thread_receive_fds(void *data) goto error; } + /* Blocking call, waiting for transmission */ + sock = lttcomm_accept_unix_sock(client_socket); + if (sock <= 0) { + WARN("On accept, retrying"); + goto error; + } while (1) { - /* Blocking call, waiting for transmission */ - sock = lttcomm_accept_unix_sock(client_socket); - if (sock <= 0) { - WARN("On accept, retrying"); - continue; - } /* We first get the number of fd we are about to receive */ ret = lttcomm_recv_unix_sock(sock, &tmp, -- 2.34.1