about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/common.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-07-25 16:48:19 +0200
committerGitHub <noreply@github.com>2024-07-25 16:48:19 +0200
commitd1070df553d84d8409f890745a9fdb2eb10cbb64 (patch)
treeaed0706d1d7fec02764727f1633b4301382a677b /compiler/rustc_codegen_llvm/src/common.rs
parentae71900ef6e68a8b497f9b5ab255977fcfb64d36 (diff)
parent17b4fbc388ec11a3c1cdf7e33ff00a0322edaf98 (diff)
downloadrust-d1070df553d84d8409f890745a9fdb2eb10cbb64.tar.gz
rust-d1070df553d84d8409f890745a9fdb2eb10cbb64.zip
Rollup merge of #127300 - biabbas:fix_connect_timeout, r=tgross35
Fix connect timeout for non-linux targets, read readiness of socket connection, Read readiness to detect errors. `Fixes #127018`

Fixes #127018
Connect_timeout would call `poll` and check `pollfd.revents` for POLLHUP error, rather that checking readiness. This behavior was meant for Linux as it returns POLLHUP | POLLOUT | POLLERR in case of errors. But on targets that do not return POLLHUP in `pollfd.revents`, this would indicate a false success and result in this issue. To resolve this we will check readiness of socket using  `getsockopt():`  and return success from connect_timeout when there are no errors.
Changes were tested on Linux and an rtos.
![Screenshot 2024-07-04 105820](https://github.com/rust-lang/rust/assets/88673422/5ef5a87f-f2af-4fb7-98da-7612d5e27e9a)
Thank you.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/common.rs')
0 files changed, 0 insertions, 0 deletions