Commit e15babbd authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

restorer: exit all threads in case of error

sys_exit() takes down only the currect thread. exit_group() should
be used to take down all threads.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Looks-good-to: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent e2ba4892
......@@ -56,6 +56,7 @@ __NR_set_thread_area 205 sys_set_thread_area (user_desc_t *info)
__NR_get_thread_area 211 sys_get_thread_area (user_desc_t *info)
__NR_set_tid_address 218 sys_set_tid_address (int *tid_addr)
__NR_restart_syscall 219 sys_restart_syscall (void)
__NR_exit_group 231 sys_exit_group (int error_code)
__NR_open_by_handle_at 304 sys_open_by_handle_at (int mountdirfd, struct file_handle *handle, int flags)
__NR_setns 308 sys_setns (int fd, int nstype)
__NR_kcmp 312 sys_kcmp (pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2)
......@@ -47,7 +47,7 @@ static void sigchld_handler(int signal, siginfo_t *siginfo, void *data)
futex_abort_and_wake(&task_entries->nr_in_progress);
/* sa_restorer may be unmaped, so we can't go back to userspace*/
sys_kill(sys_getpid(), SIGSTOP);
sys_exit(1);
sys_exit_group(1);
}
static void restore_creds(struct creds_entry *ce)
......@@ -226,7 +226,7 @@ long __export_restore_thread(struct thread_restore_args *args)
core_restore_end:
write_num_n(__LINE__);
write_num_n(sys_getpid());
sys_exit(-1);
sys_exit_group(1);
return -1;
}
......@@ -687,7 +687,7 @@ long __export_restore_task(struct task_restore_core_args *args)
core_restore_end:
write_num_n(__LINE__);
write_num_n(sys_getpid());
sys_exit(-1);
sys_exit_group(1);
return -1;
core_restore_failed:
......
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