Commit e8cbfac9 authored by Pieter Hintjens's avatar Pieter Hintjens

Merge pull request #503 from chazmcgarvey/define-dummy-eproto

define a dummy EPROTO for platforms that don't use it
parents abc8907e ba3e18f7
......@@ -44,6 +44,11 @@
#include <netdb.h>
#endif
// EPROTO is not used by OpenBSD and maybe other platforms.
#ifndef EPROTO
#define EPROTO 0
#endif
namespace zmq
{
const char *errno_to_string (int errno_);
......
......@@ -195,13 +195,8 @@ 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 OR_ERRNO_EQ_EPROTO ||
errno == EINTR || errno == ECONNABORTED || errno == EPROTO ||
errno == ENFILE);
return retired_fd;
}
......
......@@ -262,13 +262,8 @@ 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 OR_ERRNO_EQ_EPROTO ||
errno == EINTR || errno == ECONNABORTED || errno == EPROTO ||
errno == ENOBUFS || errno == ENOMEM || errno == EMFILE ||
errno == ENFILE);
return retired_fd;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment