diff options
author | rickyz <rickyz@chromium.org> | 2015-07-01 15:50:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-01 22:50:45 +0000 |
commit | 8055dc7e2a9f54f57a34493af10fc67675da4b19 (patch) | |
tree | e54462b4d1d13abcfc8b9e3a0b54e68fcda026df /base/process | |
parent | 3636a6b51af4f1995f159e3ac89468218a752d61 (diff) | |
download | chromium_src-8055dc7e2a9f54f57a34493af10fc67675da4b19.zip chromium_src-8055dc7e2a9f54f57a34493af10fc67675da4b19.tar.gz chromium_src-8055dc7e2a9f54f57a34493af10fc67675da4b19.tar.bz2 |
Allow terminating processes with a pid of 1.
This occurs when the init process of a PID namespace calls
base::Process::Current().Terminate.
BUG=485762
Review URL: https://codereview.chromium.org/1212843010
Cr-Commit-Position: refs/heads/master@{#337127}
Diffstat (limited to 'base/process')
-rw-r--r-- | base/process/process_posix.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/base/process/process_posix.cc b/base/process/process_posix.cc index 47b0d5b..b6f22c1 100644 --- a/base/process/process_posix.cc +++ b/base/process/process_posix.cc @@ -295,9 +295,10 @@ void Process::Close() { #if !defined(OS_NACL_NONSFI) bool Process::Terminate(int exit_code, bool wait) const { - // result_code isn't supportable. + // exit_code isn't supportable. DCHECK(IsValid()); - DCHECK_GT(process_, 1); + CHECK_GT(process_, 0); + bool result = kill(process_, SIGTERM) == 0; if (result && wait) { int tries = 60; |