[CRIU] [PATCH] cr-check: fix kcmp check

Filipe Brandenburger filbranden at google.com
Wed Mar 16 07:08:30 PDT 2016


On Mar 16, 2016 3:08 AM, "Laurent Dufour" <ldufour at linux.vnet.ibm.com>
wrote:
> The commit 16e673c2f6a0 ("cr-check: Inspect errno on syscall
> failures") reverts the way the returned the error returned by kcmp is
> checked. As a consequence 'criu check' is always failing with the
> following message:
>
> Error (cr-check.c:165): System call kcmp is not supported: No such process
>
> This patch ensure is reported only if syscall(SYS_kcmp) returns
> ENOSYS.

Looks good, sorry for the mistake in the conversion.

Saied told me the same thing yesterday, I think he was incorporating a
similar fix in his refactor of cr-check too.

Thanks for the fix!

> Fixes: 16e673c2f6a0 ("cr-check: Inspect errno on syscall failures")
> Cc: Filipe Brandenburger <filbranden at google.com>
> Cc: Pavel Emelyanov <xemul at virtuozzo.com>
> Signed-off-by: Laurent Dufour <ldufour at linux.vnet.ibm.com>
> ---
>  criu/cr-check.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/criu/cr-check.c b/criu/cr-check.c
> index 0572c60858a4..ea0368427a55 100644
> --- a/criu/cr-check.c
> +++ b/criu/cr-check.c
> @@ -161,7 +161,7 @@ static int check_kcmp(void)
>  {
>         int ret = syscall(SYS_kcmp, getpid(), -1, -1, -1, -1);
>
> -       if (ret < 0 && errno != ENOSYS) {
> +       if (ret < 0 && errno == ENOSYS) {
>                 pr_perror("System call kcmp is not supported");
>                 return -1;
>         }
> --
> 1.9.1
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20160316/045cd2b4/attachment.html>


More information about the CRIU mailing list