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

Unified Diff: base/process_util_posix.cc

Issue 10827112: base: Fix minor warnings reported by cppcheck. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: base/process_util_posix.cc
diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc
index 018296c5628b341310b395f548cb961df35e8df0..441a9cf00fc455879b85ca1863841d6c00a1d1ed 100644
--- a/base/process_util_posix.cc
+++ b/base/process_util_posix.cc
@@ -253,11 +253,7 @@ bool KillProcess(ProcessHandle process_id, int exit_code, bool wait) {
DCHECK_GT(process_id, 1) << " tried to kill invalid process_id";
if (process_id <= 1)
return false;
- static unsigned kMaxSleepMs = 1000;
- unsigned sleep_ms = 4;
-
bool result = kill(process_id, SIGTERM) == 0;
-
if (result && wait) {
int tries = 60;
@@ -267,6 +263,9 @@ bool KillProcess(ProcessHandle process_id, int exit_code, bool wait) {
tries *= 2;
}
+ static const unsigned kMaxSleepMs = 1000;
jar (doing other things) 2012/08/03 17:20:19 nit: No need for static. Also, declare as close a
+ unsigned sleep_ms = 4;
+
// The process may not end immediately due to pending I/O
bool exited = false;
while (tries-- > 0) {

Powered by Google App Engine
This is Rietveld 408576698