Commit a28d53f4 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Cyrill Gorcunov

restore: Don't init master thread args

This one is skipped at restore and leaves an open core file
in target task's fdtable.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 368c4a50
...@@ -1509,6 +1509,10 @@ static void sigreturn_restore(pid_t pstree_pid, pid_t pid) ...@@ -1509,6 +1509,10 @@ static void sigreturn_restore(pid_t pstree_pid, pid_t pid)
for (i = 0; i < pstree_entry.nr_threads; i++) { for (i = 0; i < pstree_entry.nr_threads; i++) {
read_ptr_safe(fd_pstree, &thread_args[i].pid, err); read_ptr_safe(fd_pstree, &thread_args[i].pid, err);
/* skip self */
if (thread_args[i].pid == pid)
continue;
/* Core files are to be opened */ /* Core files are to be opened */
thread_args[i].fd_core = open_image_ro_nocheck(FMT_FNAME_CORE, thread_args[i].pid); thread_args[i].fd_core = open_image_ro_nocheck(FMT_FNAME_CORE, thread_args[i].pid);
if (thread_args[i].fd_core < 0) if (thread_args[i].fd_core < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment