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

Side by Side Diff: base/process_util_posix.cc

Issue 195073: posix: trivial error message cleanup (Closed)
Patch Set: Created 11 years, 3 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 | « no previous file | no next file » | 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 322
323 void RaiseProcessToHighPriority() { 323 void RaiseProcessToHighPriority() {
324 // On POSIX, we don't actually do anything here. We could try to nice() or 324 // On POSIX, we don't actually do anything here. We could try to nice() or
325 // setpriority() or sched_getscheduler, but these all require extra rights. 325 // setpriority() or sched_getscheduler, but these all require extra rights.
326 } 326 }
327 327
328 bool DidProcessCrash(bool* child_exited, ProcessHandle handle) { 328 bool DidProcessCrash(bool* child_exited, ProcessHandle handle) {
329 int status; 329 int status;
330 const int result = HANDLE_EINTR(waitpid(handle, &status, WNOHANG)); 330 const int result = HANDLE_EINTR(waitpid(handle, &status, WNOHANG));
331 if (result == -1) { 331 if (result == -1) {
332 LOG(ERROR) << "waitpid failed pid:" << handle << " errno:" << errno; 332 LOG(ERROR) << "waitpid(" << handle << "): " << strerror(errno);
333 if (child_exited) 333 if (child_exited)
334 *child_exited = false; 334 *child_exited = false;
335 return false; 335 return false;
336 } else if (result == 0) { 336 } else if (result == 0) {
337 // the child hasn't exited yet. 337 // the child hasn't exited yet.
338 if (child_exited) 338 if (child_exited)
339 *child_exited = false; 339 *child_exited = false;
340 return false; 340 return false;
341 } 341 }
342 342
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 const ProcessFilter* filter) { 635 const ProcessFilter* filter) {
636 bool exited_cleanly = 636 bool exited_cleanly =
637 WaitForProcessesToExit(executable_name, wait_milliseconds, 637 WaitForProcessesToExit(executable_name, wait_milliseconds,
638 filter); 638 filter);
639 if (!exited_cleanly) 639 if (!exited_cleanly)
640 KillProcesses(executable_name, exit_code, filter); 640 KillProcesses(executable_name, exit_code, filter);
641 return exited_cleanly; 641 return exited_cleanly;
642 } 642 }
643 643
644 } // namespace base 644 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698