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

Unified Diff: base/debug/stack_trace_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/debug/stack_trace_posix.cc
diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
index 6c90b2ba3f7ec986f7c141700c7cbefe08e99423..1ccee680ca983ae0f379c517d5dd9d0f84d5eb3b 100644
--- a/base/debug/stack_trace_posix.cc
+++ b/base/debug/stack_trace_posix.cc
@@ -30,6 +30,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/posix/eintr_wrapper.h"
+#include "base/process_util.h"
#include "base/string_number_conversions.h"
#if defined(USE_SYMBOLIZE)
@@ -301,11 +302,7 @@ bool EnableInProcessStackDumping() {
// When running in an application, our code typically expects SIGPIPE
// to be ignored. Therefore, when testing that same code, it should run
// with SIGPIPE ignored as well.
- struct sigaction action;
- memset(&action, 0, sizeof(action));
- action.sa_handler = SIG_IGN;
- sigemptyset(&action.sa_mask);
- bool success = (sigaction(SIGPIPE, &action, NULL) == 0);
+ bool success = base::IgnoreSigPipe();
// Avoid hangs during backtrace initialization, see above.
WarmUpBacktrace();
« no previous file with comments | « base/debug/stack_trace_android.cc ('k') | base/process_util.h » ('j') | base/process_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698