diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-08 20:33:46 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-08 20:33:46 +0000 |
commit | cffa687fd4696dc06ab84ff3c2a170293831ec31 (patch) | |
tree | 6bc364ae69425c4ddd8bcd6c1f767474ec16ac3b /ipc | |
parent | 47c190b19c6aee03e7665d4a4e27a65f679fa005 (diff) | |
download | chromium_src-cffa687fd4696dc06ab84ff3c2a170293831ec31.zip chromium_src-cffa687fd4696dc06ab84ff3c2a170293831ec31.tar.gz chromium_src-cffa687fd4696dc06ab84ff3c2a170293831ec31.tar.bz2 |
Fix up sun_path_len so that it is consistent across all our platforms.
BUG=none
TEST=build
Review URL: http://codereview.chromium.org/5587006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68625 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/ipc_channel_posix.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc index 4a32f44..a285995 100644 --- a/ipc/ipc_channel_posix.cc +++ b/ipc/ipc_channel_posix.cc @@ -145,7 +145,11 @@ int ChannelNameToFD(const std::string& channel_id) { } //------------------------------------------------------------------------------ -const size_t kMaxPipeNameLength = sizeof(((sockaddr_un*)0)->sun_path); +// The standard size on linux is 108, mac is 104. To maintain consistency +// across platforms we standardize on the smaller value. +const size_t kMaxPipeNameLength = 104; +COMPILE_ASSERT(sizeof(((sockaddr_un*)0)->sun_path) >= kMaxPipeNameLength, + BAD_SUN_PATH_LENGTH); // Creates a Fifo with the specified name ready to listen on. bool CreateServerFifo(const std::string& pipe_name, int* server_listen_fd) { |