| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 // Simple wrapper and basic configuration of Google breakpad. We try | 5 // Simple wrapper and basic configuration of Google breakpad. We try |
| 6 // to avoid using any unnecessary code (like libbase) to make it as | 6 // to avoid using any unnecessary code (like libbase) to make it as |
| 7 // non-intrusive as possible to link in this library. | 7 // non-intrusive as possible to link in this library. |
| 8 | 8 |
| 9 #include <errno.h> | 9 #include <errno.h> |
| 10 #include <pwd.h> | 10 #include <pwd.h> |
| 11 #include <stddef.h> | 11 #include <stddef.h> |
| 12 #include <sys/stat.h> | 12 #include <sys/stat.h> |
| 13 #include <sys/types.h> | 13 #include <sys/types.h> |
| 14 #include <unistd.h> | 14 #include <unistd.h> |
| 15 | 15 |
| 16 #include "client/linux/handler/exception_handler.h" | 16 #include "client/linux/handler/exception_handler.h" |
| 17 #include "common/linux/linux_libc_support.h" | 17 #include "common/linux/linux_libc_support.h" |
| 18 #include "common/linux/linux_syscall_support.h" | 18 #include "common/linux/linux_syscall_support.h" |
| 19 #include "crash/crash_dumper.h" | 19 #include "crash-dumper/crash_dumper.h" |
| 20 | 20 |
| 21 // Define sys_mkdir (sys_open passes mode_t as int, so we do too). | 21 // Define sys_mkdir (sys_open passes mode_t as int, so we do too). |
| 22 LSS_INLINE _syscall2(int, mkdir, const char *, pathname, int, mode); | 22 LSS_INLINE _syscall2(int, mkdir, const char *, pathname, int, mode); |
| 23 | 23 |
| 24 static const char kDefaultUser[] = "chronos"; | 24 static const char kDefaultUser[] = "chronos"; |
| 25 static const char kSystemCrashParentPath[] = "/var/spool"; | 25 static const char kSystemCrashParentPath[] = "/var/spool"; |
| 26 static const char kSystemCrashPath[] = "/var/spool/crash"; | 26 static const char kSystemCrashPath[] = "/var/spool/crash"; |
| 27 static const char kUserCrashParentPath[] = "/home/chronos/user"; | 27 static const char kUserCrashParentPath[] = "/home/chronos/user"; |
| 28 static const char kUserCrashPath[] = "/home/chronos/user/crash"; | 28 static const char kUserCrashPath[] = "/home/chronos/user/crash"; |
| 29 | 29 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 } | 127 } |
| 128 | 128 |
| 129 void CrashDumper::Disable() { | 129 void CrashDumper::Disable() { |
| 130 CHECK_CONDITION(s_enabled, "Crash handling was not enabled"); | 130 CHECK_CONDITION(s_enabled, "Crash handling was not enabled"); |
| 131 delete s_breakpad_handler; | 131 delete s_breakpad_handler; |
| 132 s_breakpad_handler = NULL; | 132 s_breakpad_handler = NULL; |
| 133 s_crash_path = NULL; | 133 s_crash_path = NULL; |
| 134 s_crash_parent_path = NULL; | 134 s_crash_parent_path = NULL; |
| 135 s_enabled = false; | 135 s_enabled = false; |
| 136 } | 136 } |
| OLD | NEW |