summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authordank@chromium.org <dank@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 14:00:59 +0000
committerdank@chromium.org <dank@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 14:00:59 +0000
commit9fd697a913c5fb85f4fadace288bc9fe398e8b94 (patch)
treea68693e1dbba6c7a52991ae2243823c2ecf2aab7 /base
parent5c3bcccb4c6ac538b385e52ab9a00a9fa06615d4 (diff)
downloadchromium_src-9fd697a913c5fb85f4fadace288bc9fe398e8b94.zip
chromium_src-9fd697a913c5fb85f4fadace288bc9fe398e8b94.tar.gz
chromium_src-9fd697a913c5fb85f4fadace288bc9fe398e8b94.tar.bz2
Fix tools/valgrind/chrome_tests.sh to always use --log-file option
so fork() doesn't corrupt log files; lets --generate_suppressions work even with the hacky valgrind fix that makes anything but --log-file crash on child of fork(). Also avoid killing user desktop session if zygote dies! BUG=none, but related to fix for http://crbug.com/15771 TEST=patch valgrind with fork workaround; sh tools/valgrind/chrome_tests.sh --generate_suppressions -t ui logs you out on linux without this. Review URL: http://codereview.chromium.org/155130 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20024 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/process_util_posix.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc
index 212638f..c6c1783 100644
--- a/base/process_util_posix.cc
+++ b/base/process_util_posix.cc
@@ -64,6 +64,12 @@ ProcessId GetProcId(ProcessHandle process) {
// entry structure. Ignores specified exit_code; posix can't force that.
// Returns true if this is successful, false otherwise.
bool KillProcess(ProcessHandle process_id, int exit_code, bool wait) {
+ DCHECK(process_id > 1);
+ if (process_id <= 1) {
+ LOG(ERROR) << "tried to kill process_id " << process_id;
+ return false;
+ }
+
bool result = kill(process_id, SIGTERM) == 0;
if (result && wait) {