File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ impl Source for Socket {
3535 }
3636}
3737
38+ #[ cfg( target_endian = "little" ) ]
3839#[ cfg( test) ]
3940mod tests {
4041 use super :: * ;
Original file line number Diff line number Diff line change @@ -426,7 +426,7 @@ impl Socket {
426426 libc:: SOL_NETLINK ,
427427 libc:: NETLINK_PKTINFO ,
428428 ) ?;
429- Ok ( res == 1 )
429+ Ok ( res != 0 )
430430 }
431431
432432 pub fn add_membership ( & self , group : u32 ) -> Result < ( ) > {
@@ -473,7 +473,7 @@ impl Socket {
473473 libc:: SOL_NETLINK ,
474474 libc:: NETLINK_BROADCAST_ERROR ,
475475 ) ?;
476- Ok ( res == 1 )
476+ Ok ( res != 0 )
477477 }
478478
479479 /// `NETLINK_NO_ENOBUFS` (since Linux 2.6.30). This flag can be used by
@@ -494,7 +494,7 @@ impl Socket {
494494 libc:: SOL_NETLINK ,
495495 libc:: NETLINK_NO_ENOBUFS ,
496496 ) ?;
497- Ok ( res == 1 )
497+ Ok ( res != 0 )
498498 }
499499
500500 /// `NETLINK_LISTEN_ALL_NSID` (since Linux 4.2). When set, this socket will
@@ -518,7 +518,7 @@ impl Socket {
518518 libc:: SOL_NETLINK ,
519519 libc:: NETLINK_LISTEN_ALL_NSID ,
520520 ) ?;
521- Ok ( res == 1 )
521+ Ok ( res != 0 )
522522 }
523523
524524 /// `NETLINK_CAP_ACK` (since Linux 4.2). The kernel may fail to allocate the
@@ -543,7 +543,7 @@ impl Socket {
543543 libc:: SOL_NETLINK ,
544544 libc:: NETLINK_CAP_ACK ,
545545 ) ?;
546- Ok ( res == 1 )
546+ Ok ( res != 0 )
547547 }
548548
549549 /// `NETLINK_EXT_ACK`
@@ -565,7 +565,7 @@ impl Socket {
565565 libc:: SOL_NETLINK ,
566566 libc:: NETLINK_EXT_ACK ,
567567 ) ?;
568- Ok ( res == 1 )
568+ Ok ( res != 0 )
569569 }
570570
571571 /// Sets socket receive buffer in bytes.
You can’t perform that action at this time.
0 commit comments