Commit 5e106696 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Remove more usages of iterators after fork()

BUG=923166
R=thestig

Change-Id: I05eb7dbfe270fce342295a569728b34be3a3f77b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566354
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#650548}
parent 3ea3fb6f
...@@ -575,16 +575,20 @@ static bool GetAppOutputInternal( ...@@ -575,16 +575,20 @@ static bool GetAppOutputInternal(
// Adding another element here? Remeber to increase the argument to // Adding another element here? Remeber to increase the argument to
// reserve(), above. // reserve(), above.
for (const auto& i : fd_shuffle1) // Cannot use STL iterators here, since debug iterators use locks.
fd_shuffle2.push_back(i); // NOLINTNEXTLINE(modernize-loop-convert)
for (size_t i = 0; i < fd_shuffle1.size(); ++i)
fd_shuffle2.push_back(fd_shuffle1[i]);
if (!ShuffleFileDescriptors(&fd_shuffle1)) if (!ShuffleFileDescriptors(&fd_shuffle1))
_exit(127); _exit(127);
CloseSuperfluousFds(fd_shuffle2); CloseSuperfluousFds(fd_shuffle2);
for (const auto& arg : argv) // Cannot use STL iterators here, since debug iterators use locks.
argv_cstr.push_back(const_cast<char*>(arg.c_str())); // NOLINTNEXTLINE(modernize-loop-convert)
for (size_t i = 0; i < argv.size(); ++i)
argv_cstr.push_back(const_cast<char*>(argv[i].c_str()));
argv_cstr.push_back(nullptr); argv_cstr.push_back(nullptr);
if (do_search_path) if (do_search_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment