Skip to content

Commit

Permalink
For UNIX domain sockets on linux, connect() may yield EAGAIN to indic…
Browse files Browse the repository at this point in the history
…ate an in-progress operation.
  • Loading branch information
chriskohlhoff committed Apr 5, 2022
1 parent d96c300 commit 03334bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/boost/asio/detail/impl/socket_ops.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,12 @@ int connect(socket_type s, const socket_addr_type* addr,
get_last_error(ec, result != 0);
#if defined(__linux__)
if (result != 0 && ec == boost::asio::error::try_again)
ec = boost::asio::error::no_buffer_space;
{
if (addr->sa_family == AF_UNIX)
ec = boost::asio::error::in_progress;
else
ec = boost::asio::error::no_buffer_space;
}
#endif // defined(__linux__)
return result;
}
Expand Down

0 comments on commit 03334bb

Please sign in to comment.