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

Unified Diff: base/process_util_posix.cc

Issue 11280010: Extract SIGPIPE ignoring code to a common place. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ios 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
Index: base/process_util_posix.cc
diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc
index a19cc2a999ecb5bc8b469778420afb1fb4b0f28b..9bc19e3676f6d1af5073f84c167fef787f6184bc 100644
--- a/base/process_util_posix.cc
+++ b/base/process_util_posix.cc
@@ -154,6 +154,15 @@ void ResetChildSignalHandlersToDefaults() {
} // anonymous namespace
+bool IgnoreSigPipe() {
+ struct sigaction action;
+ memset(&action, 0, sizeof(action));
+ action.sa_handler = SIG_IGN;
+ if (sigemptyset(&action.sa_mask) != 0)
+ return false;
+ return (sigaction(SIGPIPE, &action, NULL) == 0);
+}
+
ProcessId GetCurrentProcId() {
return getpid();
}

Powered by Google App Engine
This is Rietveld 408576698