summaryrefslogtreecommitdiff
path: root/test/sys/test_sockopt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test/sys/test_sockopt.rs')
-rw-r--r--test/sys/test_sockopt.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/sys/test_sockopt.rs b/test/sys/test_sockopt.rs
index 92769e52..81db8248 100644
--- a/test/sys/test_sockopt.rs
+++ b/test/sys/test_sockopt.rs
@@ -1,9 +1,10 @@
use rand::{thread_rng, Rng};
-use nix::sys::socket::{socket, sockopt, getsockopt, setsockopt, AddressFamily, SockType, SockFlag, SockLevel};
+use nix::sys::socket::{socket, sockopt, getsockopt, setsockopt, AddressFamily, SockType, SockFlag, SockProtocol};
#[test]
fn test_so_buf() {
- let fd = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), SockLevel::Udp as i32).unwrap();
+ let fd = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), SockProtocol::Udp)
+ .unwrap();
let bufsize: usize = thread_rng().gen_range(4096, 131072);
setsockopt(fd, sockopt::SndBuf, &bufsize).unwrap();
let actual = getsockopt(fd, sockopt::SndBuf).unwrap();