diff options
Diffstat (limited to 'chrome/browser/zygote_main_linux.cc')
-rw-r--r-- | chrome/browser/zygote_main_linux.cc | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/chrome/browser/zygote_main_linux.cc b/chrome/browser/zygote_main_linux.cc index 65a44ae..2ab36e2 100644 --- a/chrome/browser/zygote_main_linux.cc +++ b/chrome/browser/zygote_main_linux.cc @@ -167,10 +167,10 @@ class Zygote { break; HandleReapRequest(fd, pickle, iter); return false; - case ZygoteHost::kCmdDidProcessCrash: + case ZygoteHost::kCmdGetTerminationStatus: if (!fds.empty()) break; - HandleDidProcessCrash(fd, pickle, iter); + HandleGetTerminationStatus(fd, pickle, iter); return false; case ZygoteHost::kCmdGetSandboxStatus: HandleGetSandboxStatus(fd, pickle, iter); @@ -209,26 +209,31 @@ class Zygote { ProcessWatcher::EnsureProcessTerminated(actual_child); } - void HandleDidProcessCrash(int fd, const Pickle& pickle, void* iter) { + void HandleGetTerminationStatus(int fd, const Pickle& pickle, void* iter) { base::ProcessHandle child; if (!pickle.ReadInt(&iter, &child)) { - LOG(WARNING) << "Error parsing DidProcessCrash request from browser"; + LOG(WARNING) << "Error parsing GetTerminationStatus request " + << "from browser"; return; } - bool child_exited; - bool did_crash; + base::TerminationStatus status; + int exit_code; if (g_suid_sandbox_active) child = real_pids_to_sandbox_pids[child]; - if (child) - did_crash = base::DidProcessCrash(&child_exited, child); - else - did_crash = child_exited = false; + if (child) { + status = base::GetTerminationStatus(child, &exit_code); + } else { + // Assume that if we can't find the child in the sandbox, then + // it terminated normally. + status = base::TERMINATION_STATUS_NORMAL_TERMINATION; + exit_code = 0; + } Pickle write_pickle; - write_pickle.WriteBool(did_crash); - write_pickle.WriteBool(child_exited); + write_pickle.WriteInt(static_cast<int>(status)); + write_pickle.WriteInt(exit_code); if (HANDLE_EINTR(write(fd, write_pickle.data(), write_pickle.size())) != write_pickle.size()) { PLOG(ERROR) << "write"; |