michael@0: // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #include "base/debug_util.h" michael@0: michael@0: #include michael@0: michael@0: #include "base/basictypes.h" michael@0: michael@0: static void ExitSignalHandler(int sig) { michael@0: exit(128 + sig); michael@0: } michael@0: michael@0: // static michael@0: void DebugUtil::DisableOSCrashDumps() { michael@0: int signals_to_intercept[] ={SIGINT, michael@0: SIGHUP, michael@0: SIGTERM, michael@0: SIGABRT, michael@0: SIGILL, michael@0: SIGTRAP, michael@0: SIGEMT, michael@0: SIGFPE, michael@0: SIGBUS, michael@0: SIGSEGV, michael@0: SIGSYS, michael@0: SIGPIPE, michael@0: SIGXCPU, michael@0: SIGXFSZ}; michael@0: // For all these signals, just wire thing sup so we exit immediately. michael@0: for (size_t i = 0; i < arraysize(signals_to_intercept); ++i) { michael@0: signal(signals_to_intercept[i], ExitSignalHandler); michael@0: } michael@0: }