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

Side by Side Diff: base/process_util_posix.cc

Issue 1432003: Minor C++ fixes found by Clang. (Closed)
Patch Set: rebase Created 10 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 | « no previous file | base/tuple_unittest.cc » ('j') | base/tuple_unittest.cc » ('J')
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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 max_fds = INT_MAX; 214 max_fds = INT_MAX;
215 215
216 DirReaderPosix fd_dir(kFDDir); 216 DirReaderPosix fd_dir(kFDDir);
217 217
218 if (!fd_dir.IsValid()) { 218 if (!fd_dir.IsValid()) {
219 // Fallback case: Try every possible fd. 219 // Fallback case: Try every possible fd.
220 for (rlim_t i = 0; i < max_fds; ++i) { 220 for (rlim_t i = 0; i < max_fds; ++i) {
221 const int fd = static_cast<int>(i); 221 const int fd = static_cast<int>(i);
222 if (fd == STDIN_FILENO || fd == STDOUT_FILENO || fd == STDERR_FILENO) 222 if (fd == STDIN_FILENO || fd == STDOUT_FILENO || fd == STDERR_FILENO)
223 continue; 223 continue;
224 InjectiveMultimap::const_iterator i; 224 InjectiveMultimap::const_iterator j;
225 for (i = saved_mapping.begin(); i != saved_mapping.end(); i++) { 225 for (j = saved_mapping.begin(); j != saved_mapping.end(); j++) {
226 if (fd == i->dest) 226 if (fd == j->dest)
227 break; 227 break;
228 } 228 }
229 if (i != saved_mapping.end()) 229 if (j != saved_mapping.end())
230 continue; 230 continue;
231 231
232 // Since we're just trying to close anything we can find, 232 // Since we're just trying to close anything we can find,
233 // ignore any error return values of close(). 233 // ignore any error return values of close().
234 int unused ALLOW_UNUSED = HANDLE_EINTR(close(fd)); 234 int unused ALLOW_UNUSED = HANDLE_EINTR(close(fd));
235 } 235 }
236 return; 236 return;
237 } 237 }
238 238
239 const int dir_fd = fd_dir.fd(); 239 const int dir_fd = fd_dir.fd();
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 const ProcessFilter* filter) { 917 const ProcessFilter* filter) {
918 bool exited_cleanly = 918 bool exited_cleanly =
919 WaitForProcessesToExit(executable_name, wait_milliseconds, 919 WaitForProcessesToExit(executable_name, wait_milliseconds,
920 filter); 920 filter);
921 if (!exited_cleanly) 921 if (!exited_cleanly)
922 KillProcesses(executable_name, exit_code, filter); 922 KillProcesses(executable_name, exit_code, filter);
923 return exited_cleanly; 923 return exited_cleanly;
924 } 924 }
925 925
926 } // namespace base 926 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/tuple_unittest.cc » ('j') | base/tuple_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698