Skip to content

Commit adfe59a

Browse files
committed
fix on mac
1 parent 778dd31 commit adfe59a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/fcntl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use {Error, Result, NixPath};
22
use errno::Errno;
3-
use libc::{mode_t, c_int};
3+
use libc::{c_int, c_uint};
44
use sys::stat::Mode;
55
use std::os::unix::io::RawFd;
66

@@ -99,7 +99,7 @@ mod ffi {
9999

100100
pub fn open<P: ?Sized + NixPath>(path: &P, oflag: OFlag, mode: Mode) -> Result<RawFd> {
101101
let fd = try!(path.with_nix_path(|cstr| {
102-
unsafe { ffi::open(cstr.as_ptr(), oflag.bits(), mode.bits() as mode_t) }
102+
unsafe { ffi::open(cstr.as_ptr(), oflag.bits(), mode.bits() as c_uint) }
103103
}));
104104

105105
if fd < 0 {

src/sys/socket/consts.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ mod os {
204204
pub const IP_ADD_MEMBERSHIP: c_int = 12;
205205
pub const IP_DROP_MEMBERSHIP: c_int = 13;
206206

207-
#[cfg(not(target_os = "netbsd"))]
207+
#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "netbsd", target_os = "dragonfly")))]
208208
pub const IPV6_ADD_MEMBERSHIP: c_int = libc::IPV6_ADD_MEMBERSHIP;
209-
#[cfg(not(target_os = "netbsd"))]
209+
#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "netbsd", target_os = "dragonfly")))]
210210
pub const IPV6_DROP_MEMBERSHIP: c_int = libc::IPV6_DROP_MEMBERSHIP;
211-
211+
212212
pub type InAddrT = u32;
213213

214214
// Declarations of special addresses

src/sys/socket/sockopt.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ sockopt_impl!(Both, TcpNoDelay, consts::IPPROTO_TCP, consts::TCP_NODELAY, bool);
121121
sockopt_impl!(Both, Linger, consts::SOL_SOCKET, consts::SO_LINGER, super::linger);
122122
sockopt_impl!(SetOnly, IpAddMembership, consts::IPPROTO_IP, consts::IP_ADD_MEMBERSHIP, super::ip_mreq);
123123
sockopt_impl!(SetOnly, IpDropMembership, consts::IPPROTO_IP, consts::IP_DROP_MEMBERSHIP, super::ip_mreq);
124-
#[cfg(not(target_os = "netbsd"))]
124+
#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "netbsd", target_os = "dragonfly")))]
125125
sockopt_impl!(SetOnly, Ipv6AddMembership, consts::IPPROTO_IPV6, consts::IPV6_ADD_MEMBERSHIP, super::ipv6_mreq);
126-
#[cfg(not(target_os = "netbsd"))]
126+
#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "netbsd", target_os = "dragonfly")))]
127127
sockopt_impl!(SetOnly, Ipv6DropMembership, consts::IPPROTO_IPV6, consts::IPV6_DROP_MEMBERSHIP, super::ipv6_mreq);
128128
sockopt_impl!(Both, IpMulticastTtl, consts::IPPROTO_IP, consts::IP_MULTICAST_TTL, u8);
129129
sockopt_impl!(Both, IpMulticastLoop, consts::IPPROTO_IP, consts::IP_MULTICAST_LOOP, bool);

0 commit comments

Comments
 (0)