From 3315dec93167ee4c4a7d0e2169039fd9da28d0c3 Mon Sep 17 00:00:00 2001 From: Fenrir Date: Tue, 13 Feb 2018 00:25:33 -0700 Subject: [PATCH] Don't use ioctl for TcpStream::connect_timeout libctru exposes ioctl, but using it causes an ENODEV error. --- ctr-std/src/sys/unix/net.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ctr-std/src/sys/unix/net.rs b/ctr-std/src/sys/unix/net.rs index 8a17786..b41dc1f 100644 --- a/ctr-std/src/sys/unix/net.rs +++ b/ctr-std/src/sys/unix/net.rs @@ -317,10 +317,8 @@ impl Socket { Ok(raw != 0) } - // TODO: Fix libc::FIONBIO and remove explicit cast pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { - let mut nonblocking = nonblocking as libc::c_int; - cvt(unsafe { libc::ioctl(*self.as_inner(), libc::FIONBIO as u32, &mut nonblocking) }).map(|_| ()) + self.0.set_nonblocking(nonblocking) } pub fn take_error(&self) -> io::Result> {