[CRIU] Re: [PATCH] parasite: Initialize fd in parasite_get_proc_fd

Pavel Emelyanov xemul at parallels.com
Tue Sep 11 10:56:43 EDT 2012


On 09/11/2012 06:48 PM, Cyrill Gorcunov wrote:
> Otherwise I get
> 
>  | parasite.c: In function ‘parasite_service’:
>  | parasite.c:383:11: error: ‘fd’ may be used uninitialized in this function [-Werror=uninitialized]
>  | cc1: all warnings being treated as errors
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  parasite.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/parasite.c b/parasite.c
> index 1885812..8c5a4d5 100644
> --- a/parasite.c
> +++ b/parasite.c
> @@ -380,7 +380,7 @@ static int init(struct parasite_init_args *args)
>  static char proc_mountpoint[] = "proc.crtools";
>  static int parasite_get_proc_fd()
>  {
> -	int ret, fd;
> +	int ret, fd = -1;
>  	char buf[2];
>  
>  	ret = sys_readlink("/proc/self", buf, sizeof(buf));

Applied



More information about the CRIU mailing list