mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 23:35:21 +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:
@@ -371,7 +371,7 @@ static int shmem_remap(pid_t pid, struct shmems *old_addr,
|
||||
if (new_addr->nr_shmems != old_addr->nr_shmems)
|
||||
pr_err("shmem_remap failed\n");
|
||||
|
||||
return 0;
|
||||
return 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_thread_vma_len);
|
||||
ret = shmem_remap(shmems->pid, shmems, shmems_ref);
|
||||
if (ret)
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
/*
|
||||
@@ -1626,6 +1626,7 @@ static void sigreturn_restore(pid_t pstree_pid, pid_t pid)
|
||||
task_args->shmems = shmems_ref;
|
||||
task_args->fd_core = fd_core;
|
||||
task_args->fd_self_vmas = fd_self_vmas;
|
||||
task_args->shmems_fd = ret;
|
||||
strncpy(task_args->self_vmas_path,
|
||||
self_vmas_path,
|
||||
sizeof(task_args->self_vmas_path));
|
||||
|
@@ -78,6 +78,7 @@ struct task_restore_core_args {
|
||||
thread_restore_fcall_t clone_restore_fn; /* helper address for clone() call */
|
||||
struct thread_restore_args *thread_args; /* array of thread arguments */
|
||||
struct shmems *shmems;
|
||||
int shmems_fd;
|
||||
} __aligned(sizeof(long));
|
||||
|
||||
struct pt_regs {
|
||||
|
Reference in New Issue
Block a user