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

Side by Side Diff: components/nacl/zygote/nacl_fork_delegate_linux.cc

Issue 126823003: posix LaunchProcess: remove more iterator usage that was missed in r243401 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « base/process/launch_posix.cc ('k') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "components/nacl/zygote/nacl_fork_delegate_linux.h" 5 #include "components/nacl/zygote/nacl_fork_delegate_linux.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <sys/resource.h> 9 #include <sys/resource.h>
10 #include <sys/socket.h> 10 #include <sys/socket.h>
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 base::LaunchOptions options; 191 base::LaunchOptions options;
192 options.fds_to_remap = &fds_to_map; 192 options.fds_to_remap = &fds_to_map;
193 options.clone_flags = CLONE_FS | SIGCHLD; 193 options.clone_flags = CLONE_FS | SIGCHLD;
194 194
195 // The NaCl processes spawned may need to exceed the ambient soft limit 195 // The NaCl processes spawned may need to exceed the ambient soft limit
196 // on RLIMIT_AS to allocate the untrusted address space and its guard 196 // on RLIMIT_AS to allocate the untrusted address space and its guard
197 // regions. The nacl_helper itself cannot just raise its own limit, 197 // regions. The nacl_helper itself cannot just raise its own limit,
198 // because the existing limit may prevent the initial exec of 198 // because the existing limit may prevent the initial exec of
199 // nacl_helper_bootstrap from succeeding, with its large address space 199 // nacl_helper_bootstrap from succeeding, with its large address space
200 // reservation. 200 // reservation.
201 std::set<int> max_these_limits; 201 std::vector<int> max_these_limits;
202 max_these_limits.insert(RLIMIT_AS); 202 max_these_limits.push_back(RLIMIT_AS);
203 options.maximize_rlimits = &max_these_limits; 203 options.maximize_rlimits = &max_these_limits;
204 204
205 if (!base::LaunchProcess(argv_to_launch, options, NULL)) 205 if (!base::LaunchProcess(argv_to_launch, options, NULL))
206 status_ = kNaClHelperLaunchFailed; 206 status_ = kNaClHelperLaunchFailed;
207 // parent and error cases are handled below 207 // parent and error cases are handled below
208 } 208 }
209 if (IGNORE_EINTR(close(fds[1])) != 0) 209 if (IGNORE_EINTR(close(fds[1])) != 0)
210 LOG(ERROR) << "close(fds[1]) failed"; 210 LOG(ERROR) << "close(fds[1]) failed";
211 if (status_ == kNaClHelperUnused) { 211 if (status_ == kNaClHelperUnused) {
212 const ssize_t kExpectedLength = strlen(kNaClHelperStartupAck); 212 const ssize_t kExpectedLength = strlen(kNaClHelperStartupAck);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 int remote_exit_code; 342 int remote_exit_code;
343 if (!iter.ReadInt(&remote_exit_code)) { 343 if (!iter.ReadInt(&remote_exit_code)) {
344 LOG(ERROR) << "GetTerminationStatus: pickle failed"; 344 LOG(ERROR) << "GetTerminationStatus: pickle failed";
345 return false; 345 return false;
346 } 346 }
347 347
348 *status = static_cast<base::TerminationStatus>(termination_status); 348 *status = static_cast<base::TerminationStatus>(termination_status);
349 *exit_code = remote_exit_code; 349 *exit_code = remote_exit_code;
350 return true; 350 return true;
351 } 351 }
OLDNEW
« no previous file with comments | « base/process/launch_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698