diff --git a/src/net/connection_client.hpp b/src/net/connection_client.hpp index a192249f3d68a01e599bf8bf35338c4bbf36b9fa..91801adf1de1fcc8ca42a649c53843530f759eea 100644 --- a/src/net/connection_client.hpp +++ b/src/net/connection_client.hpp @@ -11,6 +11,12 @@ #include <memory> #include <string> +#if EAGAIN != EWOULDBLOCK + #define EAGAIN_WRAPPER ((errno != EAGAIN) && (errno != EWOULDBLOCK)) +#else + #define EAGAIN_WRAPPER (errno != EAGAIN) +#endif + namespace rmrf::net { template<class client> diff --git a/src/net/tcp_client.cpp b/src/net/tcp_client.cpp index 7103ed134d6caf48dbd7ac6f69b8b9bb6e88ec13..2c6eca044471f0d52bce3b0896bb9b146b452a69 100644 --- a/src/net/tcp_client.cpp +++ b/src/net/tcp_client.cpp @@ -226,7 +226,7 @@ void tcp_client::push_write_queue(::ev::io &w) { if (written >= 0) { buffer.advance((size_t)written); - } else if (errno != EAGAIN) { + } else if (EAGAIN_WRAPPER) { throw netio_exception("Failed to write latest buffer content."); }