Skip to content

Commit

Permalink
fixup: bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneo committed Dec 19, 2024
1 parent 2e92b87 commit ce9c473
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/lib/event_engine/posix_engine/posix_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ PosixEventEngine::CreateEndpointFromUnconnectedFdInternal(
do {
err = poller->GetSystemApi()->Connect(fd, addr.address(), addr.size());
} while (err.ok() && *err < 0 && errno == EINTR);
if (err.ok()) {
err = *err < 0 ? errno : 0;
}
auto addr_uri = ResolvedAddressToURI(addr);
if (!addr_uri.ok()) {
Run([on_connect = std::move(on_connect),
Expand All @@ -261,7 +264,7 @@ PosixEventEngine::CreateEndpointFromUnconnectedFdInternal(
EventHandle* handle =
poller->CreateHandle(fd, name, poller->CanTrackErrors());

if (err.ok()) {
if (err.ok() && *err == 0) {
// Connection already succeeded. Return 0 to discourage any cancellation
// attempts.
Run([on_connect = std::move(on_connect),
Expand Down

0 comments on commit ce9c473

Please sign in to comment.