[CRIU] [crtools-bot for Kir Kolyshkin ] parasite_infect_seized(): use open_proc_rw()

Cyrill Gorcunov gorcunov at openvz.org
Fri Feb 17 07:46:25 EST 2012


The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
------>
commit 5434d99e9ff117c771e4ad6f3ef2836635c385e4
Author: Kir Kolyshkin <kir at openvz.org>
Date:   Fri Feb 17 01:39:34 2012 +0400

    parasite_infect_seized(): use open_proc_rw()
    
    Signed-off-by: Kir Kolyshkin <kir at openvz.org>
    Acked-by: Pavel Emelyanov <xemul at parallels.com>
    Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 parasite-syscall.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/parasite-syscall.c b/parasite-syscall.c
index 281cc69..7e25722 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -564,7 +564,6 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, int pid_dir, struct list_
 {
 	struct parasite_ctl *ctl = NULL;
 	struct vma_area *vma_area;
-	char fname[128];
 	int ret, fd;
 
 	/*
@@ -621,9 +620,8 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, int pid_dir, struct list_
 
 	ctl->map_length = round_up(parasite_size, PAGE_SIZE);
 
-	snprintf(fname, sizeof(fname), "map_files/%p-%p",
+	fd = open_proc_rw(pid_dir, "map_files/%p-%p",
 		 ctl->remote_map, ctl->remote_map + ctl->map_length);
-	fd = openat(pid_dir, fname, O_RDWR);
 	if (fd < 0) {
 		pr_perror("Can't open remote parasite map");
 		goto err_restore;


More information about the CRIU mailing list