Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/process/kill.h" | 5 #include "base/process/kill.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <signal.h> | 8 #include <signal.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <sys/wait.h> | 10 #include <sys/wait.h> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 if (exit_code) | 45 if (exit_code) |
| 46 *exit_code = status; | 46 *exit_code = status; |
| 47 | 47 |
| 48 if (WIFSIGNALED(status)) { | 48 if (WIFSIGNALED(status)) { |
| 49 switch (WTERMSIG(status)) { | 49 switch (WTERMSIG(status)) { |
| 50 case SIGABRT: | 50 case SIGABRT: |
| 51 case SIGBUS: | 51 case SIGBUS: |
| 52 case SIGFPE: | 52 case SIGFPE: |
| 53 case SIGILL: | 53 case SIGILL: |
| 54 case SIGSEGV: | 54 case SIGSEGV: |
| 55 case SIGTRAP: | |
|
Mark Mentovai
2016/07/28 18:23:34
We should add SIGSYS too.
Xianzhu
2016/07/28 19:23:39
Done.
| |
| 55 return TERMINATION_STATUS_PROCESS_CRASHED; | 56 return TERMINATION_STATUS_PROCESS_CRASHED; |
| 56 case SIGKILL: | 57 case SIGKILL: |
| 57 #if defined(OS_CHROMEOS) | 58 #if defined(OS_CHROMEOS) |
| 58 // On ChromeOS, only way a process gets kill by SIGKILL | 59 // On ChromeOS, only way a process gets kill by SIGKILL |
| 59 // is by oom-killer. | 60 // is by oom-killer. |
| 60 return TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM; | 61 return TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM; |
| 61 #endif | 62 #endif |
| 62 case SIGINT: | 63 case SIGINT: |
| 63 case SIGTERM: | 64 case SIGTERM: |
| 64 return TERMINATION_STATUS_PROCESS_WAS_KILLED; | 65 return TERMINATION_STATUS_PROCESS_WAS_KILLED; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 223 return; | 224 return; |
| 224 | 225 |
| 225 BackgroundReaper* reaper = new BackgroundReaper(pid, 0); | 226 BackgroundReaper* reaper = new BackgroundReaper(pid, 0); |
| 226 PlatformThread::CreateNonJoinable(0, reaper); | 227 PlatformThread::CreateNonJoinable(0, reaper); |
| 227 } | 228 } |
| 228 | 229 |
| 229 #endif // !defined(OS_MACOSX) | 230 #endif // !defined(OS_MACOSX) |
| 230 #endif // !defined(OS_NACL_NONSFI) | 231 #endif // !defined(OS_NACL_NONSFI) |
| 231 | 232 |
| 232 } // namespace base | 233 } // namespace base |
| OLD | NEW |