0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-14 09:47:56 +08:00

Merge pull request #501 from chazmcgarvey/conditional-eproto

do not use EPROTO on platforms that do not have it
This commit is contained in:
Pieter Hintjens 2013-01-21 14:47:35 -08:00
commit eeaa2c8e42
2 changed files with 12 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;