[CRIU] [PATCH] page-server: Add return check

Pavel Emelyanov xemul at parallels.com
Tue May 21 11:05:19 EDT 2013


On 05/21/2013 01:13 PM, Pavel Tikhomirov wrote:
> On ubuntu this don't compile if no check.
> 
> Signed-off-by: Pavel Tikhomirov <snorcht at gmail.com>
> ---
>  page-xfer.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/page-xfer.c b/page-xfer.c
> index 93b5815..4efa20c 100644
> --- a/page-xfer.c
> +++ b/page-xfer.c
> @@ -224,7 +224,10 @@ int cr_page_server(bool daemon_mode)
>  	}
>  
>  	if (daemon_mode)
> -		daemon(0, 0);
> +		if(daemon(0, 0) == -1){
> +			pr_perror("Can't run in the background");
> +			return -errno;
> +		}
>  
>  	ask = accept(sk, (struct sockaddr *)&caddr, &clen);
>  	if (ask < 0)
> 


applied


More information about the CRIU mailing list