Commit 046a1fc8 authored by Laurent Dufour's avatar Laurent Dufour Committed by Pavel Emelyanov

cr-check: fix kcmp check

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.

Fixes: 16e673c2f6a0 ("cr-check: Inspect errno on syscall failures")
Looks-good-to: Filipe Brandenburger <filbranden@google.com>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarLaurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent d693a53f
...@@ -161,7 +161,7 @@ static int check_kcmp(void) ...@@ -161,7 +161,7 @@ static int check_kcmp(void)
{ {
int ret = syscall(SYS_kcmp, getpid(), -1, -1, -1, -1); 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"); pr_perror("System call kcmp is not supported");
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment