File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -401,13 +401,11 @@ impl Ipv6MembershipRequest {
401
401
macro_rules! cmsg_space {
402
402
( $( $x: ty ) ,* ) => {
403
403
{
404
- use nix:: sys:: socket:: { c_uint, CMSG_SPACE } ;
405
- use std:: mem;
406
404
let mut space = 0 ;
407
405
$(
408
406
// CMSG_SPACE is always safe
409
407
space += unsafe {
410
- CMSG_SPACE ( mem:: size_of:: <$x>( ) as c_uint)
408
+ $crate :: sys :: socket :: CMSG_SPACE ( :: std :: mem:: size_of:: <$x>( ) as $crate :: sys :: socket :: c_uint)
411
409
} as usize ;
412
410
) *
413
411
Vec :: <u8 >:: with_capacity( space)
@@ -1775,3 +1773,11 @@ pub fn shutdown(df: RawFd, how: Shutdown) -> Result<()> {
1775
1773
Errno :: result ( shutdown ( df, how) ) . map ( drop)
1776
1774
}
1777
1775
}
1776
+
1777
+ #[ cfg( test) ]
1778
+ mod tests {
1779
+ #[ test]
1780
+ fn can_use_cmsg_space ( ) {
1781
+ let _ = cmsg_space ! ( u8 ) ;
1782
+ }
1783
+ }
You can’t perform that action at this time.
0 commit comments