Skip to content

Commit 49798be

Browse files
marjakmcarllerche
authored andcommitted
fix on mac
1 parent 73dd2e0 commit 49798be

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/fcntl.rs

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ 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;
211211

212212
#[cfg(target_os = "netbsd")]

src/sys/socket/sockopt.rs

Lines changed: 2 additions & 2 deletions
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
#[cfg(target_os = "netbsd")]
129129
sockopt_impl!(SetOnly, Ipv6AddMembership, consts::IPPROTO_IPV6, consts::IPV6_JOIN_GROUP, super::ipv6_mreq);

0 commit comments

Comments
 (0)