summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ipc/ipc_channel_posix.cc20
-rw-r--r--ipc/ipc_channel_posix.h4
-rw-r--r--net/base/listen_socket.cc1
-rw-r--r--net/base/net_util.cc1
-rw-r--r--net/base/sys_addrinfo.h3
-rw-r--r--net/base/x509_certificate_unittest.cc2
-rw-r--r--net/socket/tcp_client_socket_libevent.cc3
-rw-r--r--net/tools/hresolv/hresolv.cc2
-rw-r--r--skia/ext/image_operations.cc8
9 files changed, 25 insertions, 19 deletions
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index a2fdf38..f4d6f7b 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -273,7 +273,7 @@ Channel::ChannelImpl::ChannelImpl(const std::string& channel_id, Mode mode,
server_listen_pipe_(-1),
pipe_(-1),
client_pipe_(-1),
-#if defined(OS_LINUX)
+#if !defined(OS_MACOSX)
fd_pipe_(-1),
remote_fd_pipe_(-1),
#endif
@@ -384,7 +384,7 @@ bool Channel::ChannelImpl::CreatePipe(const std::string& channel_id,
scoped_ptr<Message> msg(new Message(MSG_ROUTING_NONE,
HELLO_MESSAGE_TYPE,
IPC::Message::PRIORITY_NORMAL));
- #if defined(OS_LINUX)
+ #if !defined(OS_MACOSX)
if (!uses_fifo_) {
// On Linux, the seccomp sandbox makes it very expensive to call
// recvmsg() and sendmsg(). Often, we are perfectly OK with resorting to
@@ -460,7 +460,7 @@ bool Channel::ChannelImpl::ProcessIncomingMessages() {
// Read from pipe.
// recvmsg() returns 0 if the connection has closed or EAGAIN if no data
// is waiting on the pipe.
-#if defined(OS_LINUX)
+#if !defined(OS_MACOSX)
if (fd_pipe_ >= 0) {
bytes_read = HANDLE_EINTR(read(pipe_, input_buf_,
Channel::kReadBufferSize));
@@ -592,7 +592,7 @@ bool Channel::ChannelImpl::ProcessIncomingMessages() {
if (m.header()->num_fds > num_fds - fds_i) {
// the message has been completely received, but we didn't get
// enough file descriptors.
-#if defined(OS_LINUX)
+#if !defined(OS_MACOSX)
if (!uses_fifo_) {
char dummy;
struct iovec fd_pipe_iov = { &dummy, 1 };
@@ -682,9 +682,9 @@ bool Channel::ChannelImpl::ProcessIncomingMessages() {
if (!m.ReadInt(&iter, &pid)) {
NOTREACHED();
}
-#if defined(OS_LINUX)
+#if !defined(OS_MACOSX)
if (mode_ == MODE_SERVER && !uses_fifo_) {
- // On Linux, the Hello message from the client to the server
+ // On non-Mac, the Hello message from the client to the server
// also contains the fd_pipe_, which will be used for all
// subsequent file descriptor passing.
DCHECK_EQ(m.file_descriptor_set()->size(), 1);
@@ -745,7 +745,7 @@ bool Channel::ChannelImpl::ProcessOutgoingMessages() {
while (!output_queue_.empty()) {
Message* msg = output_queue_.front();
-#if defined(OS_LINUX)
+#if !defined(OS_MACOSX)
scoped_ptr<Message> hello;
if (remote_fd_pipe_ != -1 &&
msg->routing_id() == MSG_ROUTING_NONE &&
@@ -806,7 +806,7 @@ bool Channel::ChannelImpl::ProcessOutgoingMessages() {
// num_fds < MAX_DESCRIPTORS_PER_MESSAGE so no danger of overflow.
msg->header()->num_fds = static_cast<uint16>(num_fds);
-#if defined(OS_LINUX)
+#if !defined(OS_MACOSX)
if (!uses_fifo_ &&
(msg->routing_id() != MSG_ROUTING_NONE ||
msg->type() != HELLO_MESSAGE_TYPE)) {
@@ -828,7 +828,7 @@ bool Channel::ChannelImpl::ProcessOutgoingMessages() {
if (bytes_written == 1) {
fd_written = pipe_;
-#if defined(OS_LINUX)
+#if !defined(OS_MACOSX)
if (mode_ != MODE_SERVER && !uses_fifo_ &&
msg->routing_id() == MSG_ROUTING_NONE &&
msg->type() == HELLO_MESSAGE_TYPE) {
@@ -999,7 +999,7 @@ void Channel::ChannelImpl::Close() {
Singleton<PipeMap>()->RemoveAndClose(pipe_name_);
client_pipe_ = -1;
}
-#if defined(OS_LINUX)
+#if !defined(OS_MACOSX)
if (fd_pipe_ != -1) {
HANDLE_EINTR(close(fd_pipe_));
fd_pipe_ = -1;
diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h
index dd45345..7cb8e1d 100644
--- a/ipc/ipc_channel_posix.h
+++ b/ipc/ipc_channel_posix.h
@@ -86,8 +86,8 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher {
// pipe_ that is passed to the client.
int client_pipe_;
-#if defined(OS_LINUX)
- // Linux uses a dedicated socketpair() for passing file descriptors.
+#if !defined(OS_MACOSX)
+ // Linux/BSD use a dedicated socketpair() for passing file descriptors.
int fd_pipe_;
int remote_fd_pipe_;
#endif
diff --git a/net/base/listen_socket.cc b/net/base/listen_socket.cc
index 88e9592..c2eb003 100644
--- a/net/base/listen_socket.cc
+++ b/net/base/listen_socket.cc
@@ -10,6 +10,7 @@
#include <winsock2.h>
#elif defined(OS_POSIX)
#include <errno.h>
+#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include "net/base/net_errors.h"
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index df08a08..ff0b6af 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -25,6 +25,7 @@
#include <ifaddrs.h>
#include <netdb.h>
#include <net/if.h>
+#include <netinet/in.h>
#include <sys/socket.h>
#endif
diff --git a/net/base/sys_addrinfo.h b/net/base/sys_addrinfo.h
index cfdd424..62a6317 100644
--- a/net/base/sys_addrinfo.h
+++ b/net/base/sys_addrinfo.h
@@ -20,5 +20,6 @@
#include <ws2tcpip.h>
#elif defined(OS_POSIX)
#include <netdb.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
#endif
-
diff --git a/net/base/x509_certificate_unittest.cc b/net/base/x509_certificate_unittest.cc
index fb550ad..63ddd92 100644
--- a/net/base/x509_certificate_unittest.cc
+++ b/net/base/x509_certificate_unittest.cc
@@ -294,7 +294,7 @@ TEST(X509CertificateTest, PaypalNullCertParsing) {
// Either the system crypto library should correctly report a certificate
// name mismatch, or our certificate blacklist should cause us to report an
// invalid certificate.
-#if defined(OS_LINUX) || defined(OS_WIN)
+#if !defined(OS_MACOSX)
EXPECT_NE(0, verify_result.cert_status &
(CERT_STATUS_COMMON_NAME_INVALID | CERT_STATUS_INVALID));
#endif
diff --git a/net/socket/tcp_client_socket_libevent.cc b/net/socket/tcp_client_socket_libevent.cc
index 581b8f4..d819ad7 100644
--- a/net/socket/tcp_client_socket_libevent.cc
+++ b/net/socket/tcp_client_socket_libevent.cc
@@ -9,6 +9,9 @@
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/tcp.h>
+#if defined(OS_POSIX)
+#include <netinet/in.h>
+#endif
#include "base/eintr_wrapper.h"
#include "base/message_loop.h"
diff --git a/net/tools/hresolv/hresolv.cc b/net/tools/hresolv/hresolv.cc
index 77ea2e5..c3858ad 100644
--- a/net/tools/hresolv/hresolv.cc
+++ b/net/tools/hresolv/hresolv.cc
@@ -51,7 +51,7 @@ static const FlagName kAddrinfoFlagNames[] = {
{AI_V4MAPPED, "AI_V4MAPPED"},
{AI_ALL, "AI_ALL"},
{AI_ADDRCONFIG, "AI_ADDRCONFIG"},
-#if defined(OS_LINUX) || defined(OS_WIN)
+#if !defined(OS_MACOSX)
{AI_NUMERICSERV, "AI_NUMERICSERV"},
#endif
};
diff --git a/skia/ext/image_operations.cc b/skia/ext/image_operations.cc
index f6ee4ca..10998d5 100644
--- a/skia/ext/image_operations.cc
+++ b/skia/ext/image_operations.cc
@@ -269,9 +269,9 @@ SkBitmap ImageOperations::Resize(const SkBitmap& source,
SkBitmap ImageOperations::ResizeSubpixel(const SkBitmap& source,
int dest_width, int dest_height,
const SkIRect& dest_subset) {
- // Currently only works on Linux because this is the only platform where
- // SkFontHost::GetSubpixelOrder is defined.
-#if defined(OS_LINUX)
+ // Currently only works on Linux/BSD because these are the only platforms
+ // where SkFontHost::GetSubpixelOrder is defined.
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
// Understand the display.
const SkFontHost::LCDOrder order = SkFontHost::GetSubpixelOrder();
const SkFontHost::LCDOrientation orientation =
@@ -361,7 +361,7 @@ SkBitmap ImageOperations::ResizeSubpixel(const SkBitmap& source,
return result;
#else
return SkBitmap();
-#endif // OS_LINUX
+#endif // OS_POSIX && !OS_MACOSX
}
// static