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

Laurent Dufour ldufour at linux.vnet.ibm.com
Wed Mar 16 03:08:22 PDT 2016


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")
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



More information about the CRIU mailing list