Commit 27994548 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Pavel Emelyanov

restore: move pid variable to local scope

cr-restore.c:1516:9: warning: Value stored to 'pid' during its initialization is never read
                pid_t pid = item->pid.real;
                      ^~~   ~~~~~~~~~~~~~~
cr-restore.c:1570:9: warning: Value stored to 'pid' during its initialization is never read
                pid_t pid = item->pid.real;
                      ^~~   ~~~~~~~~~~~~~~
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 8ea1bee4
......@@ -1397,7 +1397,6 @@ static int attach_to_tasks(bool root_seized)
struct pstree_item *item;
for_each_pstree_item(item) {
pid_t pid = item->pid.real;
int status, i;
if (!task_alive(item))
......@@ -1407,7 +1406,7 @@ static int attach_to_tasks(bool root_seized)
return -1;
for (i = 0; i < item->nr_threads; i++) {
pid = item->threads[i].real;
pid_t pid = item->threads[i].real;
if (item != root_item || !root_seized || i != 0) {
if (ptrace(PTRACE_SEIZE, pid, 0, 0)) {
......@@ -1451,7 +1450,6 @@ static int catch_tasks(bool root_seized, enum trace_flags *flag)
struct pstree_item *item;
for_each_pstree_item(item) {
pid_t pid = item->pid.real;
int status, i, ret;
if (!task_alive(item))
......@@ -1461,7 +1459,7 @@ static int catch_tasks(bool root_seized, enum trace_flags *flag)
return -1;
for (i = 0; i < item->nr_threads; i++) {
pid = item->threads[i].real;
pid_t pid = item->threads[i].real;
if (ptrace(PTRACE_INTERRUPT, pid, 0, 0)) {
pr_perror("Can't interrupt the %d task", pid);
......
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