[CRIU] [PATCH] dump: Fix test for syscall return

Cyrill Gorcunov gorcunov at openvz.org
Fri Feb 10 09:34:47 EST 2012


Reported-by: Kir Kolyshkin <kir at openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-dump.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cr-dump.c b/cr-dump.c
index 97c0ca6..2251d96 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -582,21 +582,21 @@ static int get_task_regs(pid_t pid, struct core_entry *core)
 	jerr(ptrace(PTRACE_GETFPREGS,	pid, NULL, &fpregs), err);
 
 	/* Did we come from a system call? */
-	if (regs.orig_ax >= 0)
+	if ((int)regs.orig_ax >= 0) {
 		/* Restart the system call */
-		switch (regs.ax) {
+		switch ((long)(int)regs.ax) {
 		case -ERESTARTNOHAND:
 		case -ERESTARTSYS:
 		case -ERESTARTNOINTR:
 			regs.ax = regs.orig_ax;
 			regs.ip -= 2;
 			break;
-
 		case -ERESTART_RESTARTBLOCK:
 			regs.ax = __NR_restart_syscall;
 			regs.ip -= 2;
 			break;
 		}
+	}
 
 	assign_reg(core->arch.gpregs, regs,		r15);
 	assign_reg(core->arch.gpregs, regs,		r14);
-- 
1.7.7.6



More information about the CRIU mailing list