Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(669)

Unified Diff: chrome/browser/chromeos/web_socket_proxy.cc

Issue 11280010: Extract SIGPIPE ignoring code to a common place. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: documented return value Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process_util_posix.cc ('k') | chrome/test/webdriver/webdriver_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/web_socket_proxy.cc
diff --git a/chrome/browser/chromeos/web_socket_proxy.cc b/chrome/browser/chromeos/web_socket_proxy.cc
index f1ef630b9df4d09faf98c104849e002946204390..4edae06bb42b413c7cb71f4a2fce11c04791d6e2 100644
--- a/chrome/browser/chromeos/web_socket_proxy.cc
+++ b/chrome/browser/chromeos/web_socket_proxy.cc
@@ -32,6 +32,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop.h"
+#include "base/process_util.h"
#include "base/sequenced_task_runner_helpers.h"
#include "base/sha1.h"
#include "base/stl_util.h"
@@ -101,18 +102,6 @@ bool SetNonBlock(int fd) {
return flags >= 0 && fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0;
}
-// Returns true on success.
-bool IgnoreSigPipe() {
- struct sigaction sa;
- sa.sa_handler = SIG_IGN;
- sa.sa_flags = 0;
- if (sigemptyset(&sa.sa_mask) || sigaction(SIGPIPE, &sa, 0)) {
- LOG(ERROR) << "WebSocketProxy: Failed to disable sigpipe";
- return false;
- }
- return true;
-}
-
uint64 ReadNetworkInteger(uint8* buf, int num_bytes) {
uint64 rv = 0;
DCHECK_GE(num_bytes, 0);
@@ -921,7 +910,7 @@ void Serv::Run() {
if (evdns_init())
LOG(WARNING) << "WebSocketProxy: Failed to initialize evDNS";
- if (!IgnoreSigPipe()) {
+ if (!base::IgnoreSigPipe()) {
LOG(ERROR) << "WebSocketProxy: Failed to ignore SIGPIPE";
return;
}
« no previous file with comments | « base/process_util_posix.cc ('k') | chrome/test/webdriver/webdriver_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698