mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-25 02:58:54 +00:00
criu: action-scripts -- Don't access @root_item_pid if not present
It might be nil on predump, so dereference only when present. Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com> Acked-by: Andrew Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
49877012e3
commit
cabfbbef36
1 changed files with 6 additions and 4 deletions
|
|
@ -48,10 +48,12 @@ int run_scripts(enum script_actions act)
|
|||
return -1;
|
||||
}
|
||||
|
||||
snprintf(root_item_pid, sizeof(root_item_pid), "%d", root_item->pid.real);
|
||||
if (setenv("CRTOOLS_INIT_PID", root_item_pid, 1)) {
|
||||
pr_perror("Can't set CRTOOLS_INIT_PID=%s", root_item_pid);
|
||||
return -1;
|
||||
if (root_item) {
|
||||
snprintf(root_item_pid, sizeof(root_item_pid), "%d", root_item->pid.real);
|
||||
if (setenv("CRTOOLS_INIT_PID", root_item_pid, 1)) {
|
||||
pr_perror("Can't set CRTOOLS_INIT_PID=%s", root_item_pid);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
list_for_each_entry(script, &opts.scripts, node) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue