diff --git a/src/mio.rs b/src/mio.rs index 0b76aa4..60c3982 100644 --- a/src/mio.rs +++ b/src/mio.rs @@ -35,6 +35,7 @@ impl Source for Socket { } } +#[cfg(target_endian = "little")] #[cfg(test)] mod tests { use super::*; diff --git a/src/socket.rs b/src/socket.rs index f73b90c..f9bcb32 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -426,7 +426,7 @@ impl Socket { libc::SOL_NETLINK, libc::NETLINK_PKTINFO, )?; - Ok(res == 1) + Ok(res != 0) } pub fn add_membership(&self, group: u32) -> Result<()> { @@ -473,7 +473,7 @@ impl Socket { libc::SOL_NETLINK, libc::NETLINK_BROADCAST_ERROR, )?; - Ok(res == 1) + Ok(res != 0) } /// `NETLINK_NO_ENOBUFS` (since Linux 2.6.30). This flag can be used by @@ -494,7 +494,7 @@ impl Socket { libc::SOL_NETLINK, libc::NETLINK_NO_ENOBUFS, )?; - Ok(res == 1) + Ok(res != 0) } /// `NETLINK_LISTEN_ALL_NSID` (since Linux 4.2). When set, this socket will @@ -518,7 +518,7 @@ impl Socket { libc::SOL_NETLINK, libc::NETLINK_LISTEN_ALL_NSID, )?; - Ok(res == 1) + Ok(res != 0) } /// `NETLINK_CAP_ACK` (since Linux 4.2). The kernel may fail to allocate the @@ -543,7 +543,7 @@ impl Socket { libc::SOL_NETLINK, libc::NETLINK_CAP_ACK, )?; - Ok(res == 1) + Ok(res != 0) } /// `NETLINK_EXT_ACK` @@ -565,7 +565,7 @@ impl Socket { libc::SOL_NETLINK, libc::NETLINK_EXT_ACK, )?; - Ok(res == 1) + Ok(res != 0) } /// Sets socket receive buffer in bytes.