summaryrefslogtreecommitdiff
path: root/test/sys/test_socket.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2017-12-03 03:52:43 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2017-12-03 03:52:43 +0000
commit86ebf7b0eac4cd0d092b816060042c55ca8871c5 (patch)
tree3e4e6714d843edc493dfc3cf879d659bbd264e65 /test/sys/test_socket.rs
parentd374a1ecd3f69027a2ce28e87806f459ef3f9105 (diff)
parente1baab9dc132f18e13f446df0271a5e46723848d (diff)
downloadnix-86ebf7b0eac4cd0d092b816060042c55ca8871c5.zip
Merge #801
801: Upgrade to Bitflags 1.0 r=asomers a=Susurrus The libc_bitflags! macro was replaced with a non-recursive one supporting only public structs. I could not figure out how to make the old macro work with the upgrade, so I reworked part of the bitflags! macro directly to suit our needs, much as the original recursive macro was made. There are no uses of this macro for non-public structs, so this is not a problem for internal code. Closes #766.
Diffstat (limited to 'test/sys/test_socket.rs')
-rw-r--r--test/sys/test_socket.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/sys/test_socket.rs b/test/sys/test_socket.rs
index b3d983d3..8ec7f1fd 100644
--- a/test/sys/test_socket.rs
+++ b/test/sys/test_socket.rs
@@ -122,8 +122,7 @@ pub fn test_scm_rights() {
use nix::unistd::{pipe, read, write, close};
use nix::sys::socket::{socketpair, sendmsg, recvmsg,
AddressFamily, SockType, SockFlag,
- ControlMessage, CmsgSpace, MsgFlags,
- MSG_TRUNC, MSG_CTRUNC};
+ ControlMessage, CmsgSpace, MsgFlags};
let (fd1, fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty())
.unwrap();
@@ -154,7 +153,7 @@ pub fn test_scm_rights() {
panic!("unexpected cmsg");
}
}
- assert!(!msg.flags.intersects(MSG_TRUNC | MSG_CTRUNC));
+ assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC));
close(fd2).unwrap();
}
@@ -178,8 +177,7 @@ pub fn test_sendmsg_empty_cmsgs() {
use nix::unistd::close;
use nix::sys::socket::{socketpair, sendmsg, recvmsg,
AddressFamily, SockType, SockFlag,
- CmsgSpace, MsgFlags,
- MSG_TRUNC, MSG_CTRUNC};
+ CmsgSpace, MsgFlags};
let (fd1, fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty())
.unwrap();
@@ -199,7 +197,7 @@ pub fn test_sendmsg_empty_cmsgs() {
for _ in msg.cmsgs() {
panic!("unexpected cmsg");
}
- assert!(!msg.flags.intersects(MSG_TRUNC | MSG_CTRUNC));
+ assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC));
close(fd2).unwrap();
}
}