summaryrefslogtreecommitdiffstats
path: root/content/browser/zygote_main_linux.cc
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-20 07:51:27 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-20 07:51:27 +0000
commitbfc672a58210c2242736894510f7e86c33b5873d (patch)
treed02d34788b003c6bdc1497dfb7de098176411cfb /content/browser/zygote_main_linux.cc
parent1fcef594b9c165a92d90c53ac5b7a748cc3bdeaf (diff)
downloadchromium_src-bfc672a58210c2242736894510f7e86c33b5873d.zip
chromium_src-bfc672a58210c2242736894510f7e86c33b5873d.tar.gz
chromium_src-bfc672a58210c2242736894510f7e86c33b5873d.tar.bz2
Exit cleanly when sending kZygoteMagic failed.
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
Diffstat (limited to 'content/browser/zygote_main_linux.cc')
-rw-r--r--content/browser/zygote_main_linux.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/content/browser/zygote_main_linux.cc b/content/browser/zygote_main_linux.cc
index 4391807..6973cd8 100644
--- a/content/browser/zygote_main_linux.cc
+++ b/content/browser/zygote_main_linux.cc
@@ -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 (;;) {