Skip to content

Commit

Permalink
Merge pull request #241 from TestPlanB/master
Browse files Browse the repository at this point in the history
dump过程提高成功率
  • Loading branch information
alhah committed May 3, 2023
2 parents f0a2815 + c0acb1f commit a5430e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion koom-fast-dump/src/main/cpp/hprof_dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,18 @@ bool HprofDump::ResumeAndWait(pid_t pid) {
}
int status;
for (;;) {
if (waitpid(pid, &status, 0) != -1 || errno != EINTR) {
if (waitpid(pid, &status, 0) != -1) {
if (!WIFEXITED(status)) {
ALOGE("Child process %d exited with status %d, terminated by signal %d",
pid, WEXITSTATUS(status), WTERMSIG(status));
return false;
}
return true;
}
// if waitpid is interrupted by the signal,just call it again
if (errno == EINTR){
continue;
}
return false;
}
}
Expand Down

0 comments on commit a5430e2

Please sign in to comment.