diff options
| author | jln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-22 16:23:53 +0000 |
|---|---|---|
| committer | jln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-22 16:23:53 +0000 |
| commit | e72831cac8859a56b03ec76b1c1d4b7fe7409b9d (patch) | |
| tree | 3c94ac768191e1e02fc110e709346d3b63249373 /content/browser/zygote_host_impl_linux.cc | |
| parent | 55bb20786708942e37293a525cc94a3dd7875086 (diff) | |
| download | chromium_src-e72831cac8859a56b03ec76b1c1d4b7fe7409b9d.zip chromium_src-e72831cac8859a56b03ec76b1c1d4b7fe7409b9d.tar.gz chromium_src-e72831cac8859a56b03ec76b1c1d4b7fe7409b9d.tar.bz2 | |
Zygote: create variables for magic fd numbers
The magic number "7" was used across source files to denote the file
descriptor for the dummy fd.
BUG=None
TEST=None
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/10392176
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/zygote_host_impl_linux.cc')
| -rw-r--r-- | content/browser/zygote_host_impl_linux.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/content/browser/zygote_host_impl_linux.cc b/content/browser/zygote_host_impl_linux.cc index 0bcebd9..10214ec 100644 --- a/content/browser/zygote_host_impl_linux.cc +++ b/content/browser/zygote_host_impl_linux.cc @@ -103,7 +103,7 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) { CHECK(socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds) == 0); #endif base::FileHandleMappingVector fds_to_map; - fds_to_map.push_back(std::make_pair(fds[1], 3)); + fds_to_map.push_back(std::make_pair(fds[1], content::kZygoteSocketPairFd)); const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); if (browser_command_line.HasSwitch(switches::kZygoteCmdPrefix)) { @@ -161,13 +161,14 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) { // Start up the sandbox host process and get the file descriptor for the // renderers to talk to it. const int sfd = RenderSandboxHostLinux::GetInstance()->GetRendererSocket(); - fds_to_map.push_back(std::make_pair(sfd, 5)); + fds_to_map.push_back(std::make_pair(sfd, content::kZygoteRendererSocketFd)); int dummy_fd = -1; if (using_suid_sandbox_) { dummy_fd = socket(PF_UNIX, SOCK_DGRAM, 0); CHECK(dummy_fd >= 0); - fds_to_map.push_back(std::make_pair(dummy_fd, 7)); + fds_to_map.push_back(std::make_pair(dummy_fd, + content::kZygoteIdFd)); } base::ProcessHandle process = -1; |
