[CRIU] [PATCH] parasite: Get rid of redundant PTRACE_INTERRUPT/PTRACE_CONT tail

Cyrill Gorcunov gorcunov at openvz.org
Sun Oct 28 17:51:47 EDT 2012


The tail PTRACE_INTERRUPT/PTRACE_CONT call in parasite calling code
is redundant as far as I can say, thus get rid of it.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 parasite-syscall.c |   34 ++--------------------------------
 1 files changed, 2 insertions(+), 32 deletions(-)

diff --git a/parasite-syscall.c b/parasite-syscall.c
index 5df8ce5..6c022e8 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -185,39 +185,9 @@ retry_signal:
 	}
 
 	/*
-	 * Our code is done.
+	 * We've reached this point iif int3 is triggered inside our
+	 * parasite code. So we're done.
 	 */
-	if (ptrace(PTRACE_INTERRUPT, pid, NULL, NULL)) {
-		pr_err("Can't interrupt (pid: %d)\n", pid);
-		goto err;
-	}
-
-	if (ptrace(PTRACE_CONT, pid, NULL, NULL)) {
-		pr_err("Can't continue (pid: %d)\n", pid);
-		goto err;
-	}
-
-	if (wait4(pid, &status, __WALL, NULL) != pid) {
-		pr_err("Waited pid mismatch (pid: %d)\n", pid);
-		goto err;
-	}
-
-	if (!WIFSTOPPED(status)) {
-		pr_err("Task is still running (pid: %d)\n", pid);
-		goto err;
-	}
-
-	if (ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo)) {
-		pr_err("Can't get siginfo (pid: %d)\n", pid);
-		goto err;
-	}
-
-	if (SI_EVENT(siginfo.si_code) != PTRACE_EVENT_STOP) {
-		pr_err("si_code doesn't match (pid: %d si_code: %d)\n",
-			pid, siginfo.si_code);
-		goto err;
-	}
-
 	ret = 0;
 err:
 	return ret;
-- 
1.7.7.6



More information about the CRIU mailing list