Commit 0a26593a authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

dump, restore: Add blocked signals mask

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent 73e64bec
...@@ -408,7 +408,8 @@ err: ...@@ -408,7 +408,8 @@ err:
static int get_task_stat(pid_t pid, u8 *comm, u32 *flags, static int get_task_stat(pid_t pid, u8 *comm, u32 *flags,
u64 *start_code, u64 *end_code, u64 *start_code, u64 *end_code,
u64 *start_data, u64 *end_data, u64 *start_data, u64 *end_data,
u64 *start_stack, u64 *start_brk) u64 *start_stack, u64 *start_brk,
u64 *task_sigset)
{ {
FILE *file = NULL; FILE *file = NULL;
char *tok1, *tok2; char *tok1, *tok2;
...@@ -502,6 +503,24 @@ static int get_task_stat(pid_t pid, u8 *comm, u32 *flags, ...@@ -502,6 +503,24 @@ static int get_task_stat(pid_t pid, u8 *comm, u32 *flags,
ret = 0; ret = 0;
} }
/*
* Now signals.
*/
fclose(file);
file = fopen_proc("%d/status", "r", pid);
if (!file) {
pr_perror("Can't open %d status", pid);
goto err;
}
while (fgets(loc_buf, sizeof(loc_buf), file)) {
if (!strncmp(loc_buf, "SigCgt:", 7)) {
char *end;
*task_sigset = strtol(&loc_buf[8], &end, 16);
break;
}
}
err: err:
if (file) if (file)
fclose(file); fclose(file);
...@@ -659,7 +678,8 @@ static int dump_task_core_seized(pid_t pid, struct cr_fdset *cr_fdset) ...@@ -659,7 +678,8 @@ static int dump_task_core_seized(pid_t pid, struct cr_fdset *cr_fdset)
&core->mm_start_data, &core->mm_start_data,
&core->mm_end_data, &core->mm_end_data,
&core->mm_start_stack, &core->mm_start_stack,
&core->mm_start_brk); &core->mm_start_brk,
&core->task_sigset);
if (ret) if (ret)
goto err_free; goto err_free;
pr_info("OK\n"); pr_info("OK\n");
......
...@@ -196,6 +196,7 @@ struct core_entry { ...@@ -196,6 +196,7 @@ struct core_entry {
u64 mm_start_stack; u64 mm_start_stack;
u64 mm_start_brk; u64 mm_start_brk;
u64 mm_brk; u64 mm_brk;
u64 task_sigset;
}; };
u8 __core_pad[CKPT_CORE_SIZE]; u8 __core_pad[CKPT_CORE_SIZE];
}; };
......
...@@ -380,6 +380,11 @@ self_len_end: ...@@ -380,6 +380,11 @@ self_len_end:
goto core_restore_end; goto core_restore_end;
} }
/*
* Blocked signals.
*/
rt_sigframe->uc.uc_sigmask.sig[0] = core_entry.task_sigset;
/* /*
* sigframe is on stack. * sigframe is on stack.
*/ */
......
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