[CRIU] [PATCH] criu: remove a pid file in error cases

Andrey Vagin avagin at openvz.org
Thu Mar 3 08:21:15 PST 2016


From: Andrew Vagin <avagin at virtuozzo.com>

Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 criu/cr-restore.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index bfcbcf8..12a2257 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -2120,6 +2120,10 @@ out_kill:
 				kill(pi->pid.virt, SIGKILL);
 	}
 
+	if (opts.pidfile) {
+		if (unlink(opts.pidfile))
+			pr_perror("Unable to remove %s", opts.pidfile);
+	}
 out:
 	fini_cgroup();
 	if (clean_remaps)
-- 
2.5.0



More information about the CRIU mailing list