Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
michael@0 | 2 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 3 | // found in the LICENSE file. |
michael@0 | 4 | |
michael@0 | 5 | #include "base/debug_util.h" |
michael@0 | 6 | |
michael@0 | 7 | #include <signal.h> |
michael@0 | 8 | |
michael@0 | 9 | #include "base/basictypes.h" |
michael@0 | 10 | |
michael@0 | 11 | static void ExitSignalHandler(int sig) { |
michael@0 | 12 | exit(128 + sig); |
michael@0 | 13 | } |
michael@0 | 14 | |
michael@0 | 15 | // static |
michael@0 | 16 | void DebugUtil::DisableOSCrashDumps() { |
michael@0 | 17 | int signals_to_intercept[] ={SIGINT, |
michael@0 | 18 | SIGHUP, |
michael@0 | 19 | SIGTERM, |
michael@0 | 20 | SIGABRT, |
michael@0 | 21 | SIGILL, |
michael@0 | 22 | SIGTRAP, |
michael@0 | 23 | SIGEMT, |
michael@0 | 24 | SIGFPE, |
michael@0 | 25 | SIGBUS, |
michael@0 | 26 | SIGSEGV, |
michael@0 | 27 | SIGSYS, |
michael@0 | 28 | SIGPIPE, |
michael@0 | 29 | SIGXCPU, |
michael@0 | 30 | SIGXFSZ}; |
michael@0 | 31 | // For all these signals, just wire thing sup so we exit immediately. |
michael@0 | 32 | for (size_t i = 0; i < arraysize(signals_to_intercept); ++i) { |
michael@0 | 33 | signal(signals_to_intercept[i], ExitSignalHandler); |
michael@0 | 34 | } |
michael@0 | 35 | } |