Browse Source

Don't use ioctl for TcpStream::connect_timeout

libctru exposes ioctl, but using it causes an ENODEV error.
pull/10/head
Fenrir 7 years ago
parent
commit
3315dec931
  1. 4
      ctr-std/src/sys/unix/net.rs

4
ctr-std/src/sys/unix/net.rs

@ -317,10 +317,8 @@ impl Socket {
Ok(raw != 0) Ok(raw != 0)
} }
// TODO: Fix libc::FIONBIO and remove explicit cast
pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
let mut nonblocking = nonblocking as libc::c_int; self.0.set_nonblocking(nonblocking)
cvt(unsafe { libc::ioctl(*self.as_inner(), libc::FIONBIO as u32, &mut nonblocking) }).map(|_| ())
} }
pub fn take_error(&self) -> io::Result<Option<io::Error>> { pub fn take_error(&self) -> io::Result<Option<io::Error>> {

Loading…
Cancel
Save