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

Unified Diff: chrome/nacl/nacl_helper_linux.cc

Issue 22911027: Pass StatsTable shared memory via global descriptors on Posix rather than using named shared memory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/nacl/nacl_helper_linux.cc
diff --git a/chrome/nacl/nacl_helper_linux.cc b/chrome/nacl/nacl_helper_linux.cc
index e823b5350b98e397aecb3e11e7be666e8077b710..a533c50f80910f4067934b93e00655208ce1b171 100644
--- a/chrome/nacl/nacl_helper_linux.cc
+++ b/chrome/nacl/nacl_helper_linux.cc
@@ -77,8 +77,9 @@ void ChildNaClLoaderInit(const std::vector<int>& child_fds,
// should not fork any child processes (which the seccomp
// sandbox does) until then, because that can interfere with the
// parent's discovery of our PID.
- const int nread = HANDLE_EINTR(read(child_fds[kNaClParentFDIndex], buffer,
- kMaxReadSize));
+ const int nread = HANDLE_EINTR(
+ read(child_fds[kNaClParentFDIndex(child_fds.size())], buffer,
+ kMaxReadSize));
const std::string switch_prefix = std::string("--") +
switches::kProcessChannelID + std::string("=");
const size_t len = switch_prefix.length();
@@ -95,9 +96,9 @@ void ChildNaClLoaderInit(const std::vector<int>& child_fds,
validack = true;
}
}
- if (HANDLE_EINTR(close(child_fds[kNaClDummyFDIndex])) != 0)
+ if (HANDLE_EINTR(close(child_fds[kNaClDummyFDIndex(child_fds.size())])) != 0)
LOG(ERROR) << "close(child_fds[kNaClDummyFDIndex]) failed";
- if (HANDLE_EINTR(close(child_fds[kNaClParentFDIndex])) != 0)
+ if (HANDLE_EINTR(close(child_fds[kNaClParentFDIndex(child_fds.size())])) != 0)
LOG(ERROR) << "close(child_fds[kNaClParentFDIndex]) failed";
if (validack) {
BecomeNaClLoader(child_fds, system_info);
@@ -113,7 +114,7 @@ void ChildNaClLoaderInit(const std::vector<int>& child_fds,
bool HandleForkRequest(const std::vector<int>& child_fds,
const NaClLoaderSystemInfo& system_info,
Pickle* output_pickle) {
- if (kNaClParentFDIndex + 1 != child_fds.size()) {
+ if (kNaClParentFDIndex(child_fds.size()) + 1 != child_fds.size()) {
LOG(ERROR) << "nacl_helper: unexpected number of fds, got "
<< child_fds.size();
return false;

Powered by Google App Engine
This is Rietveld 408576698