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

Unified Diff: content/browser/renderer_host/render_sandbox_host_linux.cc

Issue 7006006: Replace OS_LINUX ifdefs with OS_POSIX & !OS_MACOSX, TOOLKIT_USES_GTK, or (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 7 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
« no previous file with comments | « content/browser/plugin_service.cc ('k') | content/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
« no previous file with comments | « content/browser/plugin_service.cc ('k') | content/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698