[CRIU] [PATCH 3/5] service: exit if accept() returned an error

Ruslan Kuprieiev kupruser at gmail.com
Fri Sep 20 15:17:23 EDT 2013


On 09/19/2013 02:37 PM, Andrey Vagin wrote:
> I don't know a reason, when accept() fails once and then goes back to
> normal work.
>
> Cc: Ruslan Kuprieiev <kupruser at gmail.com>
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>   cr-service.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cr-service.c b/cr-service.c
> index c385549..ee0f849 100644
> --- a/cr-service.c
> +++ b/cr-service.c
> @@ -273,7 +273,7 @@ int cr_service(bool daemon_mode)
>   						  &client_addr_len);
>   		if (cr_service_client->sk_fd == -1) {
>   			pr_perror("Can't accept connection.");
> -			continue;
> +			goto err;
>   		}
>   
>   		pr_info("Connected.\n");
Why not "continue"?
I thought, server must continue work and try to accept next connection.


More information about the CRIU mailing list