ipc/chromium/src/base/debug_util_mac.cc

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ipc/chromium/src/base/debug_util_mac.cc	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
     1.5 +// Use of this source code is governed by a BSD-style license that can be
     1.6 +// found in the LICENSE file.
     1.7 +
     1.8 +#include "base/debug_util.h"
     1.9 +
    1.10 +#include <signal.h>
    1.11 +
    1.12 +#include "base/basictypes.h"
    1.13 +
    1.14 +static void ExitSignalHandler(int sig) {
    1.15 +  exit(128 + sig);
    1.16 +}
    1.17 +
    1.18 +// static
    1.19 +void DebugUtil::DisableOSCrashDumps() {
    1.20 +  int signals_to_intercept[] ={SIGINT,
    1.21 +                               SIGHUP,
    1.22 +                               SIGTERM,
    1.23 +                               SIGABRT,
    1.24 +                               SIGILL,
    1.25 +                               SIGTRAP,
    1.26 +                               SIGEMT,
    1.27 +                               SIGFPE,
    1.28 +                               SIGBUS,
    1.29 +                               SIGSEGV,
    1.30 +                               SIGSYS,
    1.31 +                               SIGPIPE,
    1.32 +                               SIGXCPU,
    1.33 +                               SIGXFSZ};
    1.34 +  // For all these signals, just wire thing sup so we exit immediately.
    1.35 +  for (size_t i = 0; i < arraysize(signals_to_intercept); ++i) {
    1.36 +    signal(signals_to_intercept[i], ExitSignalHandler);
    1.37 +  }
    1.38 +}

mercurial