Conflict:NA Reference:https://gitee.com/src-openeuler/criu/pulls/26
Signed-off-by: fu.lin fulin10@huawei.com --- criu/cr-restore.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/criu/cr-restore.c b/criu/cr-restore.c index 1c92372..e70f90c 100644 --- a/criu/cr-restore.c +++ b/criu/cr-restore.c @@ -2307,6 +2307,16 @@ static int finalize_restore_detach(void) return -1; } if (ptrace(PTRACE_DETACH, pid, NULL, 0)) { + /* + * There is delta between task resume and + * `ptrace(PTRACE_DETACH)`, task maybe exit + * initiative during this time. + */ + if (errno == ESRCH) { + pr_warn("Unable to detach %d, task has dead\n", pid); + continue; + } + pr_perror("Unable to detach %d", pid); return -1; }