Move accept sequence
authorJulien Desfossez <julien.desfossez@polymtl.ca>
Tue, 24 May 2011 14:20:43 +0000 (10:20 -0400)
committerDavid Goulet <david.goulet@polymtl.ca>
Tue, 24 May 2011 14:23:29 +0000 (10:23 -0400)
We only accept one connection, so move it outside the main loop.

Signed-off-by: Julien Desfossez <julien.desfossez@polymtl.ca>
kconsumerd/kconsumerd.c

index 315095ee3c102794817176262d096e1b21089b96..96051caafdfeba7dd09b4029c16404d28769cf08 100644 (file)
@@ -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,
This page took 0.02514 seconds and 4 git commands to generate.