diff options
author | paul@chromium.org <paul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-19 19:08:30 +0000 |
---|---|---|
committer | paul@chromium.org <paul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-19 19:08:30 +0000 |
commit | ae1b7001ba325247f5cd82bb6075e4e50c936841 (patch) | |
tree | d3dbc9ed6e058b0f2ea7ed5ede0aff024e896d3c /chrome/app/chrome_dll_main.cc | |
parent | 5db1ae621ac7a1ab4fc19ca8bde53282561f88a0 (diff) | |
download | chromium_src-ae1b7001ba325247f5cd82bb6075e4e50c936841.zip chromium_src-ae1b7001ba325247f5cd82bb6075e4e50c936841.tar.gz chromium_src-ae1b7001ba325247f5cd82bb6075e4e50c936841.tar.bz2 |
Ignore SIGPIPE in the browser process.
BUG=11513 (http://crbug.com/11513).
Review URL: http://codereview.chromium.org/113570
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16398 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/chrome_dll_main.cc')
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index 81a5bc8..2bb7123 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -309,6 +309,15 @@ int ChromeMain(int argc, const char** argv) { parsed_command_line.GetSwitchValue(switches::kProcessType); if (process_type.empty()) { browser_pid = base::GetCurrentProcId(); +#if defined(OS_POSIX) + // Ignore SIGPIPE so we don't crash when writing to sockets that have been + // closed on the server end. + struct sigaction action; + action.sa_handler = SIG_IGN; + sigemptyset(&action.sa_mask); + action.sa_flags = 0; + CHECK(sigaction(SIGPIPE, &action, 0) == 0); +#endif // OS_POSIX } else { std::wstring channel_name = parsed_command_line.GetSwitchValue(switches::kProcessChannelID); |