summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMattis Marjak <mattis.marjak@gmail.com>2015-12-04 00:58:53 +0200
committerCarl Lerche <me@carllerche.com>2016-01-18 21:29:38 -0800
commit49798be4d445dc224f81eddb636997c1245cdab3 (patch)
treeba75608266e59d3615e3e2083679b2823c387b28 /src
parent73dd2e05b8d7572cc12f0bf50dbc6cde7d9eda70 (diff)
downloadnix-49798be4d445dc224f81eddb636997c1245cdab3.zip
fix on mac
Diffstat (limited to 'src')
-rw-r--r--src/fcntl.rs4
-rw-r--r--src/sys/socket/consts.rs4
-rw-r--r--src/sys/socket/sockopt.rs4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/fcntl.rs b/src/fcntl.rs
index 9b2e686a..7ff27195 100644
--- a/src/fcntl.rs
+++ b/src/fcntl.rs
@@ -1,6 +1,6 @@
use {Error, Result, NixPath};
use errno::Errno;
-use libc::{mode_t, c_int};
+use libc::{c_int, c_uint};
use sys::stat::Mode;
use std::os::unix::io::RawFd;
@@ -99,7 +99,7 @@ mod ffi {
pub fn open<P: ?Sized + NixPath>(path: &P, oflag: OFlag, mode: Mode) -> Result<RawFd> {
let fd = try!(path.with_nix_path(|cstr| {
- unsafe { ffi::open(cstr.as_ptr(), oflag.bits(), mode.bits() as mode_t) }
+ unsafe { ffi::open(cstr.as_ptr(), oflag.bits(), mode.bits() as c_uint) }
}));
if fd < 0 {
diff --git a/src/sys/socket/consts.rs b/src/sys/socket/consts.rs
index ef8c23f6..476fffbf 100644
--- a/src/sys/socket/consts.rs
+++ b/src/sys/socket/consts.rs
@@ -204,9 +204,9 @@ mod os {
pub const IP_ADD_MEMBERSHIP: c_int = 12;
pub const IP_DROP_MEMBERSHIP: c_int = 13;
- #[cfg(not(target_os = "netbsd"))]
+ #[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "netbsd", target_os = "dragonfly")))]
pub const IPV6_ADD_MEMBERSHIP: c_int = libc::IPV6_ADD_MEMBERSHIP;
- #[cfg(not(target_os = "netbsd"))]
+ #[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "netbsd", target_os = "dragonfly")))]
pub const IPV6_DROP_MEMBERSHIP: c_int = libc::IPV6_DROP_MEMBERSHIP;
#[cfg(target_os = "netbsd")]
diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs
index 6ba43666..0a07cdeb 100644
--- a/src/sys/socket/sockopt.rs
+++ b/src/sys/socket/sockopt.rs
@@ -121,9 +121,9 @@ sockopt_impl!(Both, TcpNoDelay, consts::IPPROTO_TCP, consts::TCP_NODELAY, bool);
sockopt_impl!(Both, Linger, consts::SOL_SOCKET, consts::SO_LINGER, super::linger);
sockopt_impl!(SetOnly, IpAddMembership, consts::IPPROTO_IP, consts::IP_ADD_MEMBERSHIP, super::ip_mreq);
sockopt_impl!(SetOnly, IpDropMembership, consts::IPPROTO_IP, consts::IP_DROP_MEMBERSHIP, super::ip_mreq);
-#[cfg(not(target_os = "netbsd"))]
+#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "netbsd", target_os = "dragonfly")))]
sockopt_impl!(SetOnly, Ipv6AddMembership, consts::IPPROTO_IPV6, consts::IPV6_ADD_MEMBERSHIP, super::ipv6_mreq);
-#[cfg(not(target_os = "netbsd"))]
+#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "netbsd", target_os = "dragonfly")))]
sockopt_impl!(SetOnly, Ipv6DropMembership, consts::IPPROTO_IPV6, consts::IPV6_DROP_MEMBERSHIP, super::ipv6_mreq);
#[cfg(target_os = "netbsd")]
sockopt_impl!(SetOnly, Ipv6AddMembership, consts::IPPROTO_IPV6, consts::IPV6_JOIN_GROUP, super::ipv6_mreq);