diff --git a/cr-dump.c b/cr-dump.c index 944e1e92b..23b976e2e 100644 --- a/cr-dump.c +++ b/cr-dump.c @@ -1076,16 +1076,13 @@ static void unseize_task_and_threads(const struct pstree_item *item, int st) unseize_task(item->threads[i], st); /* item->pid will be here */ } -static void pstree_switch_state(const struct list_head *list, - const struct cr_options *opts) +static void pstree_switch_state(const struct list_head *list, int st) { struct pstree_item *item; - list_for_each_entry(item, list, list) { - unseize_task_and_threads(item, opts->final_state); - if (opts->leader_only) - break; - } + pr_info("Unfreezing tasks into %d\n", st); + list_for_each_entry(item, list, list) + unseize_task_and_threads(item, st); } static int seize_threads(const struct pstree_item *item) @@ -1691,7 +1688,8 @@ err: xfree(shmems); xfree(pipes); close_cr_fdset(&glob_fdset); - pstree_switch_state(&pstree_list, opts); + pstree_switch_state(&pstree_list, + ret ? TASK_ALIVE : opts->final_state); free_pstree(&pstree_list); return ret; diff --git a/ptrace.c b/ptrace.c index 5e25186dc..8dfee46f9 100644 --- a/ptrace.c +++ b/ptrace.c @@ -22,6 +22,8 @@ int unseize_task(pid_t pid, int st) { + pr_debug("\tUnseizeing %d into %d\n", pid, st); + if (st == TASK_DEAD) kill(pid, SIGKILL); else if (st == TASK_STOPPED)