mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
restore: Add test for optional PB fields in core_entry
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
parent
5421e44b72
commit
58b0ef655f
1 changed files with 13 additions and 2 deletions
15
cr-restore.c
15
cr-restore.c
|
|
@ -391,7 +391,7 @@ static int restore_one_zombie(int pid, int exit_code)
|
|||
return -1;
|
||||
}
|
||||
|
||||
static int check_core_header(int pid, CoreEntry *core)
|
||||
static int check_core(int pid, CoreEntry *core)
|
||||
{
|
||||
int fd = -1, ret = -1;
|
||||
|
||||
|
|
@ -403,6 +403,17 @@ static int check_core_header(int pid, CoreEntry *core)
|
|||
pr_err("Core march mismatch %d\n", (int)core->mtype);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!core->tc) {
|
||||
pr_err("Core task state data missed\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!core->ids && core->tc->task_state != TASK_DEAD) {
|
||||
pr_err("Core IDS data missed for non-zombie\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
out:
|
||||
close_safe(&fd);
|
||||
|
|
@ -427,7 +438,7 @@ static int restore_one_task(int pid)
|
|||
if (ret < 0)
|
||||
return -1;
|
||||
|
||||
if (check_core_header(pid, core)) {
|
||||
if (check_core(pid, core)) {
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue