Skip to content

Commit

Permalink
Remove conditional len_t as socklen_t is now defined for aarch64-linu…
Browse files Browse the repository at this point in the history
…x-android

Fixes #73
  • Loading branch information
mehcode committed Jun 27, 2018
1 parent 79c3b2e commit d958a03
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,9 @@ impl Socket {
}

pub fn bind(&self, addr: &SocketAddr) -> io::Result<()> {
#[cfg(not(all(any(target_arch = "aarch64", target_arch = "x86_64"), target_os = "android")))]
use sys::c::socklen_t as len_t;
#[cfg(all(any(target_arch = "aarch64", target_arch = "x86_64"), target_os = "android"))]
use libc::c_int as len_t;

let (addr, len) = addr2raw(addr);
unsafe {
::cvt(c::bind(self.inner.raw(), addr, len as len_t)).map(|_| ())
::cvt(c::bind(self.inner.raw(), addr, len as c::socklen_t)).map(|_| ())
}
}

Expand Down

0 comments on commit d958a03

Please sign in to comment.