Skip to content

Commit

Permalink
Exit cleanly when sending kZygoteMagic failed.
Browse files Browse the repository at this point in the history
ChromeOS may kill chrome right after process
starts (when a user closes lid right away for example), and
sending magic number to browser process can fail. Instead of
CHECK, exit normally on chromeos.

BUG=chromium-os:17606
TEST=autotest will not crash with session manager sending SIGTERM

Review URL: http://codereview.chromium.org/7433011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93171 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
oshima@google.com committed Jul 20, 2011
1 parent 1fcef59 commit bfc672a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions content/browser/zygote_main_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,15 @@ class Zygote {
std::vector<int> empty;
bool r = UnixDomainSocket::SendMsg(kBrowserDescriptor, kZygoteMagic,
sizeof(kZygoteMagic), empty);
#if defined(OS_CHROMEOS)
LOG_IF(WARNING, r) << "Sending zygote magic failed";
// Exit normally on chromeos because session manager may send SIGTERM
// right after the process starts and it may fail to send zygote magic
// number to browser process.
_exit(content::RESULT_CODE_NORMAL_EXIT);
#else
CHECK(r) << "Sending zygote magic failed";
#endif
}

for (;;) {
Expand Down

0 comments on commit bfc672a

Please sign in to comment.