diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-11 01:00:47 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-11 01:00:47 +0000 |
commit | 7e73090e86db6a51148aed709e46c91478200107 (patch) | |
tree | 460333e280ccb2321b5abad09a724fd76827a831 /chrome | |
parent | 97c30fee110aa281dbf5ca13dbdac186bc6098ca (diff) | |
download | chromium_src-7e73090e86db6a51148aed709e46c91478200107.zip chromium_src-7e73090e86db6a51148aed709e46c91478200107.tar.gz chromium_src-7e73090e86db6a51148aed709e46c91478200107.tar.bz2 |
posix: ignore SIGPIPE in all processes, not just the browser
E.g. plugin<->renderer channel can go down, causing SIGPIPE instead of a
normal error.
Review URL: http://codereview.chromium.org/155390
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20448 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index e087a8d..6748069 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -331,20 +331,16 @@ int ChromeMain(int argc, const char** argv) { return 1; #endif +#if defined(OS_POSIX) + // Always ignore SIGPIPE. We check the return value of write(). + CHECK(signal(SIGPIPE, SIG_IGN) != SIG_ERR); +#endif // OS_POSIX + int browser_pid; std::wstring process_type = 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 { #if defined(OS_WIN) std::wstring channel_name = |