2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-04 16:25:31 +00:00

restore: Pass shmems_fd as argument as well

We might be needing to close the shmems file descriptor.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
Cyrill Gorcunov
2012-01-03 13:05:50 +04:00
parent 4416c649c8
commit d0a6e9a101
2 changed files with 4 additions and 2 deletions

View File

@@ -371,7 +371,7 @@ static int shmem_remap(pid_t pid, struct shmems *old_addr,
if (new_addr->nr_shmems != old_addr->nr_shmems) if (new_addr->nr_shmems != old_addr->nr_shmems)
pr_err("shmem_remap failed\n"); pr_err("shmem_remap failed\n");
return 0; return fd;
} }
static int prepare_shared(int ps_fd) static int prepare_shared(int ps_fd)
@@ -1616,7 +1616,7 @@ static void sigreturn_restore(pid_t pstree_pid, pid_t pid)
restore_task_vma_len + restore_task_vma_len +
restore_thread_vma_len); restore_thread_vma_len);
ret = shmem_remap(shmems->pid, shmems, shmems_ref); ret = shmem_remap(shmems->pid, shmems, shmems_ref);
if (ret) if (ret < 0)
goto err; goto err;
/* /*
@@ -1626,6 +1626,7 @@ static void sigreturn_restore(pid_t pstree_pid, pid_t pid)
task_args->shmems = shmems_ref; task_args->shmems = shmems_ref;
task_args->fd_core = fd_core; task_args->fd_core = fd_core;
task_args->fd_self_vmas = fd_self_vmas; task_args->fd_self_vmas = fd_self_vmas;
task_args->shmems_fd = ret;
strncpy(task_args->self_vmas_path, strncpy(task_args->self_vmas_path,
self_vmas_path, self_vmas_path,
sizeof(task_args->self_vmas_path)); sizeof(task_args->self_vmas_path));

View File

@@ -78,6 +78,7 @@ struct task_restore_core_args {
thread_restore_fcall_t clone_restore_fn; /* helper address for clone() call */ thread_restore_fcall_t clone_restore_fn; /* helper address for clone() call */
struct thread_restore_args *thread_args; /* array of thread arguments */ struct thread_restore_args *thread_args; /* array of thread arguments */
struct shmems *shmems; struct shmems *shmems;
int shmems_fd;
} __aligned(sizeof(long)); } __aligned(sizeof(long));
struct pt_regs { struct pt_regs {