Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(948)

Side by Side Diff: base/process/kill_posix.cc

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/process/kill.h ('k') | base/process/process.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <signal.h> 7 #include <signal.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 #include <sys/wait.h> 9 #include <sys/wait.h>
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 *exit_code = status; 43 *exit_code = status;
44 44
45 if (WIFSIGNALED(status)) { 45 if (WIFSIGNALED(status)) {
46 switch (WTERMSIG(status)) { 46 switch (WTERMSIG(status)) {
47 case SIGABRT: 47 case SIGABRT:
48 case SIGBUS: 48 case SIGBUS:
49 case SIGFPE: 49 case SIGFPE:
50 case SIGILL: 50 case SIGILL:
51 case SIGSEGV: 51 case SIGSEGV:
52 return TERMINATION_STATUS_PROCESS_CRASHED; 52 return TERMINATION_STATUS_PROCESS_CRASHED;
53 case SIGKILL:
54 #if defined(OS_CHROMEOS)
55 // On ChromeOS, only way a process gets kill by SIGKILL
56 // is by oom-killer.
57 return TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM;
58 #endif
53 case SIGINT: 59 case SIGINT:
54 case SIGKILL:
55 case SIGTERM: 60 case SIGTERM:
56 return TERMINATION_STATUS_PROCESS_WAS_KILLED; 61 return TERMINATION_STATUS_PROCESS_WAS_KILLED;
57 default: 62 default:
58 break; 63 break;
59 } 64 }
60 } 65 }
61 66
62 if (WIFEXITED(status) && WEXITSTATUS(status) != 0) 67 if (WIFEXITED(status) && WEXITSTATUS(status) != 0)
63 return TERMINATION_STATUS_ABNORMAL_TERMINATION; 68 return TERMINATION_STATUS_ABNORMAL_TERMINATION;
64 69
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 return; 220 return;
216 221
217 BackgroundReaper* reaper = new BackgroundReaper(pid, 0); 222 BackgroundReaper* reaper = new BackgroundReaper(pid, 0);
218 PlatformThread::CreateNonJoinable(0, reaper); 223 PlatformThread::CreateNonJoinable(0, reaper);
219 } 224 }
220 225
221 #endif // !defined(OS_MACOSX) 226 #endif // !defined(OS_MACOSX)
222 #endif // !defined(OS_NACL_NONSFI) 227 #endif // !defined(OS_NACL_NONSFI)
223 228
224 } // namespace base 229 } // namespace base
OLDNEW
« no previous file with comments | « base/process/kill.h ('k') | base/process/process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698