[CRIU] [PATCH] parasite: simplify syscall check

Laurent Dufour ldufour at linux.vnet.ibm.com
Tue Jul 19 09:30:07 PDT 2016


In is_required_syscall() req_sysnr is set according to the native mode
so we can check the syscall number directly against it.

No functional change expected.

Cc: Dmitry Safonov <dsafonov at virtuozzo.com>
Signed-off-by: Laurent Dufour <ldufour at linux.vnet.ibm.com>
---
 criu/parasite-syscall.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c
index 75c645f154c2..824037c0b4df 100644
--- a/criu/parasite-syscall.c
+++ b/criu/parasite-syscall.c
@@ -1043,12 +1043,8 @@ static inline int is_required_syscall(user_regs_struct_t *regs, pid_t pid,
 
 	pr_debug("%d (%s) is going to execute the syscall %lu, required is %d\n",
 		pid, mode, REG_SYSCALL_NR(*regs), req_sysnr);
-	if (user_regs_native(regs) && (REG_SYSCALL_NR(*regs) == sys_nr))
-		return true;
-	if (!user_regs_native(regs) && (REG_SYSCALL_NR(*regs) == sys_nr_compat))
-		return true;
 
-	return false;
+	return (REG_SYSCALL_NR(*regs) == req_sysnr);
 }
 /*
  * Trap tasks on the exit from the specified syscall
-- 
2.7.4



More information about the CRIU mailing list