OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/mac/os_crash_dumps.h" | 5 #include "base/mac/os_crash_dumps.h" |
6 | 6 |
7 #include <signal.h> | 7 #include <signal.h> |
8 #include <unistd.h> | 8 #include <unistd.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 // For all these signals, just wire things up so we exit immediately. | 40 // For all these signals, just wire things up so we exit immediately. |
41 for (size_t i = 0; i < arraysize(signals_to_intercept); ++i) { | 41 for (size_t i = 0; i < arraysize(signals_to_intercept); ++i) { |
42 struct sigaction act = {}; | 42 struct sigaction act = {}; |
43 act.sa_handler = ExitSignalHandler; | 43 act.sa_handler = ExitSignalHandler; |
44 | 44 |
45 // It is better to allow the signal handler to run on the stack | 45 // It is better to allow the signal handler to run on the stack |
46 // registered with sigaltstack(), if one is present. | 46 // registered with sigaltstack(), if one is present. |
47 act.sa_flags = SA_ONSTACK; | 47 act.sa_flags = SA_ONSTACK; |
48 | 48 |
49 if (sigemptyset(&act.sa_mask) != 0) | 49 if (sigemptyset(&act.sa_mask) != 0) |
50 DLOG_ERRNO(FATAL) << "sigemptyset() failed"; | 50 DPLOG(FATAL) << "sigemptyset() failed"; |
51 if (sigaction(signals_to_intercept[i], &act, NULL) != 0) | 51 if (sigaction(signals_to_intercept[i], &act, NULL) != 0) |
52 DLOG_ERRNO(FATAL) << "sigaction() failed"; | 52 DPLOG(FATAL) << "sigaction() failed"; |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 } // namespace mac | 56 } // namespace mac |
57 } // namespace base | 57 } // namespace base |
OLD | NEW |