Rollup merge of #100017 - solid-rs:patch/kmc-solid/adapt-to-78802, r=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;
    |            ^^^^^^^
```
This commit is contained in:
Matthias Krüger 2022-08-02 07:30:45 +02:00 committed by GitHub
commit 042bba799b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)?;