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

Side by Side Diff: base/process_util_posix.cc

Issue 27240: Make startup_tests build and run on Linux (except reference tests). (Closed)
Patch Set: small bugfix in process_util Created 11 years, 9 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/base.scons ('k') | base/test_file_util_posix.cc » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <dirent.h> 5 #include <dirent.h>
6 #include <errno.h> 6 #include <errno.h>
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <signal.h> 8 #include <signal.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <sys/resource.h> 10 #include <sys/resource.h>
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 return WIFEXITED(status); 241 return WIFEXITED(status);
242 else 242 else
243 return false; 243 return false;
244 } 244 }
245 245
246 bool CrashAwareSleep(ProcessHandle handle, int wait_milliseconds) { 246 bool CrashAwareSleep(ProcessHandle handle, int wait_milliseconds) {
247 int status = WaitpidWithTimeout(handle, wait_milliseconds); 247 int status = WaitpidWithTimeout(handle, wait_milliseconds);
248 if (status != -1) 248 if (status != -1)
249 return !(WIFEXITED(status) || WIFSIGNALED(status)); 249 return !(WIFEXITED(status) || WIFSIGNALED(status));
250 else 250 else
251 return false; 251 return true;
252 } 252 }
253 253
254 namespace { 254 namespace {
255 255
256 int64 TimeValToMicroseconds(const struct timeval& tv) { 256 int64 TimeValToMicroseconds(const struct timeval& tv) {
257 return tv.tv_sec * kMicrosecondsPerSecond + tv.tv_usec; 257 return tv.tv_sec * kMicrosecondsPerSecond + tv.tv_usec;
258 } 258 }
259 259
260 } 260 }
261 261
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 const ProcessFilter* filter) { 348 const ProcessFilter* filter) {
349 bool exited_cleanly = 349 bool exited_cleanly =
350 WaitForProcessesToExit(executable_name, wait_milliseconds, 350 WaitForProcessesToExit(executable_name, wait_milliseconds,
351 filter); 351 filter);
352 if (!exited_cleanly) 352 if (!exited_cleanly)
353 KillProcesses(executable_name, exit_code, filter); 353 KillProcesses(executable_name, exit_code, filter);
354 return exited_cleanly; 354 return exited_cleanly;
355 } 355 }
356 356
357 } // namespace base 357 } // namespace base
OLDNEW
« no previous file with comments | « base/base.scons ('k') | base/test_file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698