[CRIU] [PATCH 1/3] remote: Move variable declaration out of loop

Andrei Vagin avagin at gmail.com
Fri Feb 1 20:31:13 MSK 2019


Can you explain why we need this?

On Wed, Jan 30, 2019 at 09:04:47AM +0000, Radostin Stoyanov wrote:
> Signed-off-by: Radostin Stoyanov <rstoyanov1 at gmail.com>
> ---
>  criu/img-remote.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/criu/img-remote.c b/criu/img-remote.c
> index 9f49e92fd..014d3f4c5 100644
> --- a/criu/img-remote.c
> +++ b/criu/img-remote.c
> @@ -808,7 +808,7 @@ void check_pending()
>  }
>  
>  void accept_image_connections() {
> -	int ret;
> +	int ret, n_events, i;
>  
>  	epoll_fd = epoll_create(EPOLL_MAX_EVENTS);
>  	if (epoll_fd < 0) {
> @@ -840,8 +840,6 @@ void accept_image_connections() {
>  	}
>  
>  	while (1) {
> -		int n_events, i;
> -
>  		n_events = epoll_wait(epoll_fd, events, EPOLL_MAX_EVENTS, 250);
>  		if (n_events < 0) {
>  			pr_perror("Failed to epoll wait");
> -- 
> 2.20.1
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list