From 2e2ef7fd330cd009c20b349a85d54e220d714f48 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Mon, 21 Jan 2013 15:00:55 -0700 Subject: [PATCH] do not use EPROTO on platforms that do not have it --- src/ipc_listener.cpp | 7 ++++++- src/tcp_listener.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ipc_listener.cpp b/src/ipc_listener.cpp index 28b01a6e..2aa107d2 100644 --- a/src/ipc_listener.cpp +++ b/src/ipc_listener.cpp @@ -195,8 +195,13 @@ zmq::fd_t zmq::ipc_listener_t::accept () zmq_assert (s != retired_fd); fd_t sock = ::accept (s, NULL, NULL); if (sock == -1) { +#ifdef EPROTO +#define OR_ERRNO_EQ_EPROTO || errno == EPROTO +#else +#define OR_ERRNO_EQ_EPROTO +#endif errno_assert (errno == EAGAIN || errno == EWOULDBLOCK || - errno == EINTR || errno == ECONNABORTED || errno == EPROTO || + errno == EINTR || errno == ECONNABORTED OR_ERRNO_EQ_EPROTO || errno == ENFILE); return retired_fd; } diff --git a/src/tcp_listener.cpp b/src/tcp_listener.cpp index 3cd29b6c..348e623c 100644 --- a/src/tcp_listener.cpp +++ b/src/tcp_listener.cpp @@ -262,8 +262,13 @@ zmq::fd_t zmq::tcp_listener_t::accept () win_assert (brc); #else if (sock == -1) { +#ifdef EPROTO +#define OR_ERRNO_EQ_EPROTO || errno == EPROTO +#else +#define OR_ERRNO_EQ_EPROTO +#endif errno_assert (errno == EAGAIN || errno == EWOULDBLOCK || - errno == EINTR || errno == ECONNABORTED || errno == EPROTO || + errno == EINTR || errno == ECONNABORTED OR_ERRNO_EQ_EPROTO || errno == ENOBUFS || errno == ENOMEM || errno == EMFILE || errno == ENFILE); return retired_fd;