diff options
author | Bryant Mairs <bryantmairs@google.com> | 2017-11-21 22:27:15 -0800 |
---|---|---|
committer | Bryant Mairs <bryantmairs@google.com> | 2017-12-02 10:46:34 -0800 |
commit | e1baab9dc132f18e13f446df0271a5e46723848d (patch) | |
tree | 3e4e6714d843edc493dfc3cf879d659bbd264e65 /test/sys/test_socket.rs | |
parent | d374a1ecd3f69027a2ce28e87806f459ef3f9105 (diff) | |
download | nix-e1baab9dc132f18e13f446df0271a5e46723848d.zip |
Upgrade to Bitflags 1.0
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.
Diffstat (limited to 'test/sys/test_socket.rs')
-rw-r--r-- | test/sys/test_socket.rs | 10 |
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(); } } |