[CRIU] [PATCH 2/7] compel/s390: Fix return value in error path

Dmitry Safonov 0x7f454c46 at gmail.com
Mon Apr 29 17:49:43 MSK 2019


On Sun, 28 Apr 2019 at 19:45, Rikard Falkeborn
<rikard.falkeborn at gmail.com> wrote:
>
> In a function with return type bool, returning a non-zero value is
> interpreted as returning true. In the error paths we want to return
> false to indicate failure. Change -1 to false to fix this.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn at gmail.com>

Reviewed-by: Dmitry Safonov <0x7f454c46 at gmail.com>

> ---
>  compel/arch/s390/src/lib/infect.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/compel/arch/s390/src/lib/infect.c b/compel/arch/s390/src/lib/infect.c
> index fcb463fa..00e9c36d 100644
> --- a/compel/arch/s390/src/lib/infect.c
> +++ b/compel/arch/s390/src/lib/infect.c
> @@ -493,7 +493,7 @@ bool arch_can_dump_task(struct parasite_ctl *ctl)
>         if (psw->mask & PSW_MASK_RI) {
>                 if (get_ri_cb(pid, &fpregs) < 0) {
>                         pr_perror("Can't dump process with RI bit active");
> -                       return -1;
> +                       return false;
>                 }
>         }
>         /* We don't support 24 and 31 bit mode - only 64 bit */
> --
> 2.21.0
>
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu



-- 
             Dmitry


More information about the CRIU mailing list