[CRIU] [PATCH cr 10/13] shmem: used open_proc_rw to open proc files

Andrey Vagin avagin at openvz.org
Tue Jun 19 07:53:14 EDT 2012


open_proc_rw knows that proc may be mounted not in /proc,
it's used for restoring tasks in pid ns.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 shmem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/shmem.c b/shmem.c
index dccc5c7..4d6a185 100644
--- a/shmem.c
+++ b/shmem.c
@@ -121,7 +121,7 @@ static int shmem_wait_and_open(int pid, struct shmem_info *si)
 	futex_wait_until(&si->lock, 1);
 
 	pr_info("Opening shmem [%s] \n", path);
-	ret = open(path, O_RDWR);
+	ret = open_proc_rw(si->pid, "map_files/%lx-%lx", si->start, si->end);
 	if (ret < 0)
 		pr_perror("     %d: Can't stat shmem at %s",
 				si->pid, path);
-- 
1.7.1



More information about the CRIU mailing list