Skip to content
Snippets Groups Projects
Commit 970283c7 authored by Benny Baumann's avatar Benny Baumann
Browse files

chg: Platform-aware handling of EAGAIN errors

parent 5b703b2e
No related branches found
No related tags found
1 merge request!1First unit tests
...@@ -11,6 +11,12 @@ ...@@ -11,6 +11,12 @@
#include <memory> #include <memory>
#include <string> #include <string>
#if EAGAIN != EWOULDBLOCK
#define EAGAIN_WRAPPER ((errno != EAGAIN) && (errno != EWOULDBLOCK))
#else
#define EAGAIN_WRAPPER (errno != EAGAIN)
#endif
namespace rmrf::net { namespace rmrf::net {
template<class client> template<class client>
......
...@@ -226,7 +226,7 @@ void tcp_client::push_write_queue(::ev::io &w) { ...@@ -226,7 +226,7 @@ void tcp_client::push_write_queue(::ev::io &w) {
if (written >= 0) { if (written >= 0) {
buffer.advance((size_t)written); buffer.advance((size_t)written);
} else if (errno != EAGAIN) { } else if (EAGAIN_WRAPPER) {
throw netio_exception("Failed to write latest buffer content."); throw netio_exception("Failed to write latest buffer content.");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment