summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authordmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-08 20:33:46 +0000
committerdmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-08 20:33:46 +0000
commitcffa687fd4696dc06ab84ff3c2a170293831ec31 (patch)
tree6bc364ae69425c4ddd8bcd6c1f767474ec16ac3b /ipc
parent47c190b19c6aee03e7665d4a4e27a65f679fa005 (diff)
downloadchromium_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.cc6
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) {