[CRIU] [PATCH] restore: don't forget to set nr = 0, if no signal image is found(backward compatibility)

Pavel Emelyanov xemul at parallels.com
Mon Aug 25 05:07:47 PDT 2014


On 08/25/2014 01:37 PM, Ruslan Kuprieiev wrote:
> We have this bug since support for signals was added.

Can we better get rid of nr passed as pointer and
_return_ the number of signals restored from both
calls -- open_signal_image and prepare_one_signal_queue?

> Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
> ---
>  cr-restore.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/cr-restore.c b/cr-restore.c
> index 0349e3e..7ba39ae 100644
> --- a/cr-restore.c
> +++ b/cr-restore.c
> @@ -2392,9 +2392,10 @@ static int open_signal_image(int type, pid_t pid, unsigned int *nr)
>  
>  	fd = open_image(type, O_RSTR | O_OPT, pid);
>  	if (fd < 0) {
> -		if (fd == -ENOENT) /* backward compatibility */
> +		if (fd == -ENOENT) {/* backward compatibility */
> +			*nr = 0;
>  			return 0;
> -		else
> +		} else
>  			return -1;
>  	}
>  
> 



More information about the CRIU mailing list