Skip to content

Commit

Permalink
Rollup merge of #100017 - solid-rs:patch/kmc-solid/adapt-to-78802, r=…
Browse files Browse the repository at this point in the history
…thomcc

kmc-solid: Update `Socket::connect_timeout` to be in line with #78802

Fixes the build failure of the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets after #78802.

```
error[E0308]: mismatched types
   --> library\std\src\sys\solid\net.rs:234:45
    |
234 |             cvt(netc::connect(self.0.raw(), addrp, len))
    |                 -------------               ^^^^^ expected *-ptr, found union `SocketAddrCRepr`
    |                 |
    |                 arguments to this function are incorrect
    |
    = note: expected raw pointer `*const sockets::sockaddr`
                     found union `SocketAddrCRepr`
note: function defined here
   --> library\std\src\sys\solid\abi\sockets.rs:173:12
    |
    173 |     pub fn connect(s: c_int, name: *const sockaddr, namelen: socklen_t) -> c_int;
    |            ^^^^^^^
```
  • Loading branch information
matthiaskrgr authored Aug 2, 2022
2 parents beb4cdd + bfbda81 commit 042bba7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/std/src/sys/solid/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ impl Socket {
pub fn connect_timeout(&self, addr: &SocketAddr, timeout: Duration) -> io::Result<()> {
self.set_nonblocking(true)?;
let r = unsafe {
let (addrp, len) = addr.into_inner();
cvt(netc::connect(self.0.raw(), addrp, len))
let (addr, len) = addr.into_inner();
cvt(netc::connect(self.0.raw(), addr.as_ptr(), len))
};
self.set_nonblocking(false)?;

Expand Down

0 comments on commit 042bba7

Please sign in to comment.