[Sheepdog] [PATCH] fix to handle EINTR in connect_to_vost

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Apr 20 12:41:26 CEST 2010


On 2010/04/21 2:47, OZAWA Tsuyoshi wrote:
> Signed-off-by: OZAWA Tsuyoshi <ozawa.tsuyoshi at lab.ntt.co.jp>
> ---
>  block/sheepdog.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/block/sheepdog.c b/block/sheepdog.c
> index 18ecd22..ea81c34 100644
> --- a/block/sheepdog.c
> +++ b/block/sheepdog.c
> @@ -505,11 +505,13 @@ static int connect_to_vost(void)
>  		if (fd < 0)
>  			continue;
>  
> +reconnect:
>  		ret = connect(fd, res->ai_addr, res->ai_addrlen);
>  		if (!ret) {
>  			dprintf("connected to %s:%d\n", name, port);
>  			goto success;
> -		}
> +		} else if (ret == -1 && errno == EINTR)
> +			goto reconnect;
>  	}
>  	fd = -1;
>  	eprintf("failed connect to %s:%d\n", name, port);

Applied, thanks.

Kazutaka Morita




More information about the sheepdog mailing list