summaryrefslogtreecommitdiffstats
path: root/chrome/browser/zygote_main_linux.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 17:33:36 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 17:33:36 +0000
commit7ae27b9fe9b7e1a997d05e2dace01359993bb7f5 (patch)
tree5c7fdc6f8fe38475aec40c60cf869a2e5c69ece1 /chrome/browser/zygote_main_linux.cc
parent17c85709a15d3c3e6fa9d3ae9db23f654018e20e (diff)
downloadchromium_src-7ae27b9fe9b7e1a997d05e2dace01359993bb7f5.zip
chromium_src-7ae27b9fe9b7e1a997d05e2dace01359993bb7f5.tar.gz
chromium_src-7ae27b9fe9b7e1a997d05e2dace01359993bb7f5.tar.bz2
linux: zygote should suicide when the browser channel closes.
We attempt to do this when recvmsg() returns 0, indicating EOF. But man 7 unix also says we can get ECONNRESET, so accept that too. TEST=run Chrome such that it exits quickly, e.g. ./out/Debug/chrome --try-chrome-again=10001 it should not print any zygote error messages. Review URL: http://codereview.chromium.org/3387017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60486 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/zygote_main_linux.cc')
-rw-r--r--chrome/browser/zygote_main_linux.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/zygote_main_linux.cc b/chrome/browser/zygote_main_linux.cc
index fada72f..64ec0f7 100644
--- a/chrome/browser/zygote_main_linux.cc
+++ b/chrome/browser/zygote_main_linux.cc
@@ -141,17 +141,18 @@ class Zygote {
static const unsigned kMaxMessageLength = 1024;
char buf[kMaxMessageLength];
const ssize_t len = base::RecvMsg(fd, buf, sizeof(buf), &fds);
- if (len == -1) {
- LOG(WARNING) << "Error reading message from browser: " << errno;
- return false;
- }
- if (len == 0) {
+ if (len == 0 || (len == -1 && errno == ECONNRESET)) {
// EOF from the browser. We should die.
_exit(0);
return false;
}
+ if (len == -1) {
+ PLOG(ERROR) << "Error reading message from browser";
+ return false;
+ }
+
Pickle pickle(buf, len);
void* iter = NULL;