Commit 7398d9fd authored by Andrey Ryabinin's avatar Andrey Ryabinin Committed by Pavel Emelyanov

seize: slightly cleanup collect_pstree() exit path.

Use 'goto err;' everywhere. Remove 'pstree_switch_state(root_item, TASK_ALIVE)'
on error path as all collect_pstree() callers do this if collect_pstree()
failed.
Signed-off-by: 's avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 19a49e09
......@@ -622,16 +622,16 @@ err_close:
int collect_pstree(pid_t pid)
{
int ret;
int ret = -1;
timing_start(TIME_FREEZING);
if (opts.freeze_cgroup && freeze_processes())
return -1;
goto err;
root_item = alloc_pstree_item();
if (root_item == NULL)
return -1;
goto err;
root_item->pid.real = pid;
......@@ -651,14 +651,13 @@ int collect_pstree(pid_t pid)
goto err;
if (opts.freeze_cgroup && freezer_wait_processes())
return -1;
goto err;
ret = 0;
timing_stop(TIME_FREEZING);
timing_start(TIME_FROZEN);
return 0;
err:
pstree_switch_state(root_item, TASK_ALIVE);
return -1;
return ret;
}
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