Index: content/browser/renderer_host/render_sandbox_host_linux.cc |
diff --git a/content/browser/renderer_host/render_sandbox_host_linux.cc b/content/browser/renderer_host/render_sandbox_host_linux.cc |
index d0b85c126d1f3b2d84b171f3b4fbf448b9184155..16fa2c44e95db141d40452b3ed8014f0fae7dda5 100644 |
--- a/content/browser/renderer_host/render_sandbox_host_linux.cc |
+++ b/content/browser/renderer_host/render_sandbox_host_linux.cc |
@@ -665,7 +665,14 @@ void RenderSandboxHostLinux::Init(const std::string& sandbox_path) { |
// inherit some sockets. With PF_UNIX+SOCK_DGRAM, it can call sendmsg to send |
// a datagram to any (abstract) socket on the same system. With |
// SOCK_SEQPACKET, this is prevented. |
+#if defined(OS_FREEBSD) || defined(OS_OPENBSD) |
+ // The BSDs often don't support SOCK_SEQPACKET yet, so fall back to |
+ // SOCK_DGRAM if necessary. |
+ if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds) != 0) |
+ CHECK(socketpair(AF_UNIX, SOCK_DGRAM, 0, fds) == 0); |
+#else |
CHECK(socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds) == 0); |
+#endif |
renderer_socket_ = fds[0]; |
const int browser_socket = fds[1]; |