diff options
| author | Fenrir <[email protected]> | 2018-02-13 00:25:33 -0700 |
|---|---|---|
| committer | Fenrir <[email protected]> | 2018-02-13 00:25:33 -0700 |
| commit | 3315dec93167ee4c4a7d0e2169039fd9da28d0c3 (patch) | |
| tree | 0b02fac97a7e014415fe7093d1d658467fa85cd8 /ctr-std/src/sys | |
| parent | Don't output an extra newline when panicking (diff) | |
| download | ctru-rs-3315dec93167ee4c4a7d0e2169039fd9da28d0c3.tar.xz ctru-rs-3315dec93167ee4c4a7d0e2169039fd9da28d0c3.zip | |
Don't use ioctl for TcpStream::connect_timeout
libctru exposes ioctl, but using it causes an ENODEV error.
Diffstat (limited to 'ctr-std/src/sys')
| -rw-r--r-- | ctr-std/src/sys/unix/net.rs | 4 |
1 files changed, 1 insertions, 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<Option<io::Error>> { |