[1/4] restore: do not kill restored process on failure

Submitted by Adrian Reber on May 31, 2018, 9 a.m.


Message ID 1527757205-12889-2-git-send-email-adrian@lisas.de
State Accepted
Series "Series without cover letter"
Commit 0b1e74cb77f9a9be580b1e5a6383177ba1f6e146
Headers show

Commit Message

Adrian Reber May 31, 2018, 9 a.m.
From: Adrian Reber <areber@redhat.com>

While trying to resurrect the test cases in test/other/rpc one test case
was checking for returned errors during restore failures. The process
was dumping itself and while the process kept on running it tried to
restore from that checkpoint. That should fail as the PID is in use of
the process doing the test. CRIU, however, killed the test process
during restore failure.

This is the fix as proposed by Andrei Vagin on the CRIU mailing list.

Signed-off-by: Adrian Reber <areber@redhat.com>
 criu/cr-restore.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index e969c24..3564a9b 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -2556,8 +2556,8 @@  out_kill:
 		struct pstree_item *pi;
-			if (vpid(pi) > 0)
-				kill(vpid(pi), SIGKILL);
+			if (pi->pid->real > 0)
+				kill(pi->pid->real, SIGKILL);