From: Julien Desfossez Date: Tue, 24 May 2011 14:20:43 +0000 (-0400) Subject: Move accept sequence X-Git-Tag: v2.0-pre1~128 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=7e8c38c672e816ea3b0d9a7accdcae4d6e01c668 Move accept sequence We only accept one connection, so move it outside the main loop. Signed-off-by: Julien Desfossez --- 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,